At the end of 757 there was a great battle in the neighbourhood of the capital, in which An Lu-shan was defeated by the Uighurs; shortly afterwards he was murdered by one of his eunuchs. His followers fled; Loyang was captured and looted by the Uighurs.
Suddenly, however, for reasons not disclosed by the Chinese sources, the Turks withdrew, and the T'ang were able to conclude a fairly honourable peace. This was the time of the maximum power of the eastern Turks. Shortly afterwards disturbances broke out , under the leadership of Turkish Uighurs and their allies.
The Turkish Uighurs brought in to help against them were fighting actually against Turks, though they regarded those Turks as Chinese. We must not bring to the circumstances of those times the present-day notions with regard to national feeling. 7 The role of the Uighurs. Confiscation of the capital of the monasteries
The name covered Turks, Tunguses, and others; among the auxiliaries of the Mongols were Uighurs, men from Central Asia and the Middle East, and even Europeans. When the Mongols attacked China they had the advantage of all the arts and crafts and all the new technical advances of western and central Asia and of Europe.
It was hoped in this way especially to remedy the financial troubles of the moment, which were partly due to a shortage of metal for minting. As the trading capital was still placed with the temples as banks, the government attacked the religion of the Uighurs, Manichaeism, and also the religions of the other foreigners, Mazdaism, Nestorianism, and apparently also Islam.
One Boja, lord of Kashgar and Khan of what the Chinese knew as the people of Thu-Kiu probably the same name as 'Turk' embraced Islam and forced it on his Mazdeist subjects; but other Turkish tribes, notably the powerful Uighurs, remained intolerant of the new dispensation, and expelled the Thu-Kiu en masse from their holding in Turkestan into Persia.
The Chinese were able to rely on the Uighurs; above all, they were furnished by the Tölös Turks with a large army, with which they turned once more against Turkestan in 647-48, and now definitely established their rule there.
Not a few of these merchants were Uighurs and Mohammedans; many Uighurs were also employed as clerks, as the Mongols were very often unable to read and write Chinese, and the government offices were bilingual, working in Mongolian and Chinese. The clever Uighurs quickly learned enough of both languages for official purposes, and made themselves indispensable assistants to the Mongols.
In 763 the Tibetans captured and burned down the western capital, while P'u-ku Huai-en with the Uighurs advanced from the north. The Uighurs now came over into an alliance with the Chinese, and the two allies fell upon the Tibetans and robbed them of their booty. China was saved once more. Friendship with the Uighurs had to be paid for this time even more dearly.
Abroad, the Chinese lost their dominion over Turkestan, for which Uighurs and Tibetans competed. There is nothing to gain from any full description of events at court. The struggle between cliques soon became a struggle between eunuchs and literati, in much the same way as at the end of the second Han dynasty.