The temple, which literally means "rooster crowing" was first constructed in 557 during the Liang dynasty and has been destroyed and reconstructed many times.
By 1931 most temple buildings had been appropriated as barracks by police and army of the Nationalist government of Republican China.