During the Sixteen Kingdoms period, the Central Plains was contending with each other, wars broke out everywhere, and the people were displaced and in dire straits, while Hexi became a relatively stable area. A large number of scholars, Confucianism, scholars and ordinary people in the Central Plains left their homes and fled to Hexi for refuge, bringing advanced culture and production technology. In particular, Buddhism introduced from Han and Wei dynasties flourished in Dunhuang. People suffering from war fell at the feet of Buddha, hoping to get rid of suffering and live a happy and stable life. Dunhuang is the gateway and gateway of Buddhism spreading to the east, and also the center of Buddhism in Hexi area. There are a lot of Buddhist monks giving lectures in Dunhuang. Many Buddhist disciples from all over Hexi come here to study. For example, Zhu Fahu, a master of classics translation who lives in Dunhuang; Song Yun and other Dunhuang people went to India to study Buddhism. Faxian, Kumarajiva and other boiling masters have left footprints in Dunhuang no matter where they go. In the second year of Jian Yuan in the former Qin Dynasty (AD 366), the monk Le Zun first opened a cave in Daquan Valley at the foot of Sanwei Mountain, and the Mogao Grottoes were born. After that, the practice of making Buddha by opening holes continued for thousands of years, creating the world-famous Dunhuang art.
The Northern Wei Dynasty destroyed the northern cool, unified the north and occupied Hexi. During this period, Dunhuang was relatively stable, the people lived and worked in peace and contentment, and Buddhism prevailed. Northern Wei people dug 13 caves in Mogao grottoes.