Read the story
In 527, the most powerful man in southern China left his palace, walked to a new temple just north of it, and gave himself away.
He was Xiao Yan, Emperor Wu of the Liang dynasty, and he had built that temple himself. It was called Tongtai, and tradition places it right here, on the hill where Jiming Temple stands today. Emperor Wu was so devout that people called him the Bodhisattva Emperor. He gave up meat and banned animal sacrifice.
That first time, he came home after three days. Two years later he did it again, putting on a monk's robe and doing monastic chores. An emperor owned by a monastery cannot govern, so his ministers bought him back, by the usual account for one hundred million cash. In 546 he gave himself away a third time, and the ransom is said to have doubled. A fourth stay lasted thirty-seven days, and the court paid once more.
The city around him was already old. Long ago it was Jinling. Sun Quan made it his capital as Jianye in 229. In 313 it became Jiankang, and dynasty after dynasty ruled the south from here. By the sixth century, around a million people lived inside it.
In 548, a general named Hou Jing rebelled and laid siege to the capital. Tongtai Temple was destroyed in the fighting. The palace fell in 549, and the emperor, past eighty, was held under guard with his supplies cut. By one account, his mouth was bitter and he asked for honey. No one brought it. He died that summer.
Forty years later, the Sui conquered Jiankang and leveled its walls and palaces into farmland. In 1387 a Ming emperor raised a temple on the old site and named it Jiming, which means rooster crowing. Below, Xuanwu Lake still catches the first light. The hill he kept giving himself to still belongs to the temple.