Tianshui
Tianshui fills the upper Wei valley where the Loess Plateau meets the Qinling, the last well-watered basin on the road west out of the Guanzhong plain. The early Qin lords kept their seat at Qin Yi in these hills, and in 688 BC Duke Wu of Qin set up Gui county here, one of the oldest counties in China. Silk Road caravans climbed the Wei valley, and monks came with them: around 400 the Later Qin cut the first Maijishan caves into a cliff south of the city, and most of the painted clay figures the grottoes are known for were modelled under the Northern Wei and Northern Zhou, the caves linked by wooden walkways stacked up the rock face. The country also raised soldiers. The Han 'Flying General' Li Guang was a man of Chengji in Tianshui commandery, and Jiang Wei was born in Ji county here; in 228, when Zhuge Liang's first northern army entered the commandery, his own prefect suspected him and shut the gates, and Jiang Wei went over to Shu to become Zhuge Liang's most trusted successor. The poet Du Fu lodged in Qinzhou in 759 while fleeing the An Lushan wars and made the cliff the subject of his poem 'Mountain Temple'. In 1444 the city is Qinzhou, a subprefecture of Gongchang in Ming Shaanxi, trading Wei-valley grain and the tea and horses exchanged here from the early Hongwu years, its Fuxi Temple the city's chief shrine.
The Fuxi Temple was rebuilt on a grand scale under the Hongzhi and Jiajing emperors, while the Maijishan caves saw only scattered repairs through the Ming and dropped out of common notice. On the night of 21 July 1654 an earthquake broke on the country south of Qinzhou, put at magnitude eight by older accounts and at moment magnitude 7.0 by a newer study: walls and cave dwellings collapsed across four provinces and more than 30,000 people died. The city recovered, and in 1729 the Yongzheng Emperor raised Qinzhou to an independent department under the new province of Gansu, governing Qin'an, Qingshui and the neighbouring counties.