The Yungang Grottoes are located 16 km west of Datong and comprise about 53 caves and 51,000 statues. The site stretches about 1 kilometer from east to west and was hollowed from the sandstone cliffs of the Wuzhou Mountains during the 5th century CE under the patronage of the Northern Wei dynasty. Founded by the Tuoba or Toba people, who ruled northern China during the Northern and Southern Dynasties period (310-589 CE), the Wei dynasty adopted Buddhism as its state religion. Work was begun at Yungang by the emperor Wenchengdi (reigned 452-465). The caves range in width from 23 m to a few metres. In 494, the Wei moved their capital from Datong to Luoyang and the Yungang Grottoes slowly fell into decay. The Grottoes have been a UNESCO World Heritage site since 2001. Cave 1 dates from the last phase of carving, under private patronage, lasting until 525, when the construction came to a final halt due to uprisings in the area.