The Yungang Grottoes were first carved during the Northern Wei Dynasty. In 398 AD, Emperor Daowu of Northern Wei moved the capital from Shengle (present-day Helingeer County) to Pingcheng (present-day Datong City), making Wuzhou Mountain a crucial transportation hub between the two cities. After Emperor Wencheng of Northern Wei ascended the throne, he ordered the monk Tan Yao to oversee the restoration of Buddhism. With Emperor Wencheng's support, Tan Yao chose the beautiful and spiritually rich Wuzhou Mountain, "carving five caves into the mountainside, each with a Buddha statue, the tallest being seventy feet and the next sixty feet, their carvings magnificent and unparalleled in their time." Most of the caves at Yungang were completed before Emperor Xiaowen of Northern Wei moved the capital to Luoyang, but the statue-making work continued until the Zheng Guang era (520-525 AD). The Yungang Grottoes were carved over a period of about 150 years, spanning the Northern Wei, Eastern Wei, Western Wei, Northern Qi, Sui, and Tang dynasties. There are 45 main caves and 252 smaller niches, with more than 59,000 stone sculptures, making them a treasure in the Chinese grotto art treasury.