The Tang dynasty in Inner Asia was the expansion of the Tang dynasty's realm in Inner Asia in the 7th and, to a lesser degree, the 8th century AD, in the Tarim Basin, across the Gobi Desert and into Middle Asia. Wars were fought against the Gokturk Empires and Xueyantuo, but also against the states of the Tarim basin. This expansion was not steady; for example, the Tang did lose control of the Tarim basin temporarily to the Tibetans in the 680s, and their expansion north of the Gobi was thwarted in 682. Emperor Taizong's military success was, in part, a consequence of changes he initiated in the Chinese army, including improved weaponry. The emperor placed a new emphasis on cavalry, which was very important because his non-Chinese opponents used the horse effectively in warfare.
The Tang dynasty was one of the Golden Ages of Chinese history. Coming out of the devastation of the late Sui, Tang emperors were eager to secure China's borders by defeating the Gokturks who were the primary military threat to North China. As a result, Tang forces mounted several campaigns against the Gokturks in order to neutralize them and secure China's borders in the process. Securing the Tarim Basin, which contained key trade routes, was also a secondary objective.
The Eastern Gokturks were the primary threat to the Tang dynasty. Following Liang Shidu's defeat and death, the Tang dynasty prepared to march against the Eastern Gokturks. In 630, the Tang army marched against the Gokturks and defeated them in Southern Mongolia, sending them to flight. However, the real victory came when Li Jin, regarded as one of China's best generals, surprised the Eastern Gokturk Khan with a fast force of 3,000 Cavalry at the battle of Ying shan, which also involved a rear guard of over 100,000 Tang troops. This battle destroyed the Gokturk army, resulting in the capture of the Khan and over 120,000 Gokturks. Thus ended the Eastern Gokturk Empire. Emperor Taizong of Tang took up the title of Tian Kehan, or "Heavenly Khan" of the Gokturks.
Xueyantuo had helped Tang armies defeat the Eastern Gokturks, but after the demise of the Eastern Gokturks, Xueyantuo-Tang relations turned hostile because Xueyantuo kept on making attacks on Gokturks who were now Tang subjects.
The Western Gokturks were not an initial threat to the Tang, so initially relations were peaceful. However, Civil war and dispute in the Western Gokturks gave the Tang the opportunity to expand into Central Asia. From 642 to 645, the Tang army defeated the Western Gokturks and drove them out of Dzungaria.
In 657, the Tang defeated the last Western Gokturk Khan and took over all Western Gokturk territory.
In what has been described as "a response to a surge of something like national sentiment", the Eastern Türkish Kaghanate was restored in 682 by Elterish (a.k.a. Qutlugh). In the Orkhon inscriptions, Elterish's son describes the modest beginnings of Elterish's struggle against the Tang thus:
My father the kaghan set out with seventeen men, and as the word spread that he had set out and was advancing, those who were in the towns went up into the mountains and those who were in the mountains came down, they gathered, and there were seventy-seven men. Because heaven gave them strength, the army of my father was like wolves and his enemies were like sheep. [...] When they were seven hundred, in accordance with the institutions of my ancestors my father organized those who had been deprived of their state, those who had been deprived of their kaghan, who had become slaves and servants, who had lost their Türk institutions"
The new Kaghanate was centered on the upper Orkhon river and in the Ötükän, presumably the Khangai mountains. After decades of war and border raids with China, peace was made in 721-22. The second Gokturk Khanate remained a tributary and vassal of the Tang dynasty. It then survived until the 740s, when it fell due to internal conflicts and was succeeded by the Uighur Kaghanate
The Battle of Talas was a military engagement between the Arab Abbasid Caliphate along with their ally the Tibetan Empire against the Chinese Tang dynasty, governed at the time by Emperor Xuanzong. In July 751 AD, Tang and Abbasid forces met in the valley of the Talas River to vie for control of the Syr Darya region of central Asia. After a stalemate in several days of combat, the Tang lost the battle because the Karluks defected from the Tang side to the Abbasid side. The defeat marked the end of Tang westward territorial expansion, resulting in Muslim control of Transoxiana for the next four hundred years.
In 755, the Tang dynasty was subject to the devastating Anshi Rebellion and lost much influence in Inner Asia, which came to be dominated by the Uyghurs. Tang influence and rule over the Northwestern regions, however, continued until the dynasty's fall in 907, at which time these areas were taken over by the Tanguts, who later established Xi Xia.
Although they now controlled most of the Mongolian region, the Uyghur Khans still maintained relatively cordial relations with the Tang dynasty, accepting many titles from the Tang emperors. in 788, the Uyghur Khan pleaded the Tang emperor to change the title of the Uyghurs from Huihe () to Huihu ().
By the mid-800's, the power of the Uyghur Khanate was on the wane. Attacked on all sides, the Uyghurs retreated to the Xinjiang area and their Khanate collapsed, to be replaced by other peoples
The Chinese and their History and Culture.