Buddhist legends about Emperor Wu of Liang

During the reign of Emperor Wu (r. 502–549) of the Liang dynasty, he embraced and promoted Buddhism. Several times, he became a Buddhist monk and forced his court to buy him back with substantial offerings to the sangha. In 517, he ordered the destruction of Taoist temples and forced Taoist priests to return to lay life. Some of his other reforms, such as the disallowance of capital punishment and of the animal sacrifices during ancestral ceremonies, conformed with his Buddhist convictions.

Because of his constant support for Buddhism, Emperor Wu came to be viewed as the Chinese counterpart of Ashoka, the great Indian chakravartin and patron of the religion. Later writers who saw Emperor Wu's reign as a golden age of Chinese Buddhism compiled stories about the emperor's role in creating or sponsoring important Buddhist institutions or rituals. A cycle of stories developed around Baozhi, the emperor's favorite monk, and around Bodhidharma, the first patriarch of Chan Buddhism, who was alleged to have met the emperor in the 520s.