Du You
By the 650s, the Tanguts had left their homeland to escape pressure from the Tibetans and migrated eastward to what are now modern Shanxi and Shaanxi provinces. In 584-5 Tuoba Ningzong led the first group of Tanguts to submit to the Sui. In 628-9 another group under the leadership of Xifeng Bulai surrendered to the Tang. After the Tuyuhun were defeated in 635, the Tanguts under Tuoba Chici also surrendered. The 340,000 Tanguts were divided into 32 "jimi" prefectures under the control of Tangut chieftains appointed as prefects. Another wave of Tanguts entered Tang territory in 692, adding as many as 200,000 persons to the population in Lingzhou and Xiazhou. In 721-2, Tuoba Sitai, a descendant of Tuoba Chici, aided the Tang in putting down a Sogdian-led revolt in Shuofang. By the time of the An Lushan Rebellion in the 750s, the Tanguts had become the primary local power in the Ordos region in northern Shaanxi. In the 760s, the military commander, Ashina Sijian, harassed six Tangut tribes and took their camels and horses. The Tanguts fled west across the Yellow River and started working for the Tibetans as guides on raiding expeditions. In 764, the Tanguts joined the Tibetans and Uyghurs in supporting the Tang rebel Pugu Huaien. After the Tang reasserted their authority, a descendant of Tuoba Chici, Tuoba Chaoguang, was put in charge of the loyal Tanguts. The Yeli, Bali, and Bozhou clans continued to side with the Tibetans, however the Tanguts also came under Tibetan predation, and frontier settlements continued switching between Tang and Tibetan control for many years. In 806, the Acting Minister of Works, Du You, admitted that they treated the Tanguts badly: