7th century , the
Western city-states (640-648) and the
Western Turks (657). The Protectorate General to Pacify the West is marked as "Anxi Protectorate". The Western Regions during the Tang era were known as Qixi (磧西). Qi refers to the
Gobi Desert while Xi refers to the west. In 632 the oasis kingdoms of
Khotan (Yutian) and
Shule (Kashgar) submitted to the Tang dynasty as vassals. In 635
Yarkand (Shache) submitted to the Tang dynasty. On 19 September 640
Hou Junji of Tang conquered
Gaochang and set up Xi Prefecture (西州) in its place. Xi Prefecture became the seat of the Anxi Protectorate on 11 October. Qiao Shiwang became the first protector general of the Anxi and served from 640 to 642. Guo Xiaoke received the next post and served from 640 to 648. By 644
Karasahr was also conquered, and was known to the Chinese as Yanqi.
Aksu (Gumo) was garrisoned by Tang troops. In 648, the Tang conquered
Kucha, known to the Chinese as Qiuci, and made it the new seat of Anxi under the governance of Chai Zhewei from 649 to 651. By 650 the entire Western Region had submitted to Tang authority. In 651 the seat was moved back to Xi Prefecture where it remained under the governance of Qu Zhizhan from 651 to 658. In 656 the
Tibetan Empire attacked
Lesser Bolü in
Gilgit southwest of the protectorate. In 658 the seat was moved back to Qiuci after
Su Dingfang defeated the
Western Turkic Khaganate. Its title was changed to "Grand Protectorate" and granted governorship of former Western Turkic territories, which were further separated into the Mengchi and Kunling protectorates. In 660 the Tibetan Empire and their Turkic allies attacked Shule. The Tibetan Empire also attacked
Wakhan to the protectorate's southwest. When the Tang general boasted of the size of his army,
Gar Tongtsen Yulsung's son responded in the following manner: In 663 the Tibetan Empire conquered
Tuyuhun southeast of the protectorate. They also attacked Yutian but were repelled. In 665 the Tibetan Empire and Turkic allies attacked Yutian. The conflict between the Tang and Tibetans was the primary context under which the story of a Khotanese princess striving to rescue Khotan from destruction was formulated. One passage of the story in prayer form reads: In 670 the Tibetan Empire routed a Tang army at the
Battle of Dafei River and attacked Gumo as well as captured Qiuci. The protectorate's seat was moved to
Suyab, known as Suiye to the Chinese, in modern
Kyrgyzstan. In 673 the Tang consolidated control over the Wuduolu Turks living in the area that came to be known as
Dzungaria. The Tang also captured Qiuci and established control over the Western Regions in the same year. In 677 the Tibetan Empire captured Qiuci. In the same year Ashina Duzhi, previously a Tang general tasked with controlling the Wuduolu Turks, rebelled and declared himself Onoq Khagan, ruler of all Turks. In 679 the Tang general, Pei Xingjian, defeated Ashina Duzhi as well as the Tibetans and established control over the Western Regions. In 686 Tang troops withdrew from the Four Garrisons after elements within the court argued for the decrease of military expenditures. In 687 the Tibetan Empire established control over the Western Regions. In 690 the Tibetan Empire defeated a Tang army at
Issyk-Kul. In 692 Tang troops under
Wang Xiaojie pacified the Western Regions and established the Anxi Protectorate at Qiuci, where it would remain until the protectorate's demise around 790. The importance of the Western Regions was well understood by the Tang court at this point. Its strategic significance is summarized by Cui Rong, an Imperial Diarist of the court, In 694 the
Tibetan Empire attacked the Stone City (
Charklik).
8th century envoys 6th century AD. , 6-7th centuries AD. In 702 Wu Zetian set up the
Beiting Protectorate in Ting Prefecture (
Jimsar County) and granted it governorship over Yi Prefecture (
Hami) and Xi Prefecture. In 708 the
Turgesh attacked Qiuci. In 710 the Tibetan Empire conquered Lesser Bolü. Arab sources claim
Qutayba ibn Muslim briefly took Kashgar from China and withdrew after an agreement but modern historians entirely dismiss this claim. In 715 the Tibetan Empire attacked
Fergana, a Tang vassal. In 717 the Tibetan Empire attacked Gumo and the Stone City. The Arab
Umayyad Caliphate in 715 AD deposed
Ikhshid, the king the
Fergana Valley, and installed a new king Alutar on the throne. The deposed king fled to
Kucha (seat of
Anxi Protectorate) and sought Chinese intervention. The Chinese sent 10,000 troops under
Zhang Xiaosong to
Ferghana. He defeated Alutar and the Arab occupation force at
Namangan and reinstalled Ikhshid on the throne. General Tang Jiahui led the Chinese to defeat the following Arab-Tibetan attack in the
Battle of Aksu (717). The attack on Aksu was joined by
Turgesh Khan
Suluk. In 719 the Turgesh captured Suiye. In 720 the Tibetan Empire seized the Stone City. In the same year Tang bestowed titles upon the kings of
Khuttal,
Chitral, and
Oddiyana In 722 Tang restored the king of Lesser Bolü to his throne. In 725 the king of Khotan (Yutian) rebelled but was immediately replaced with a Tang puppet by protectorate forces. In 726 the Turgesh attempted to engage in horse trade at Qiuci without prior authorization. The Turgesh Khagan
Suluk used his marital relation with Princess Jiaohe to issue a decree ordering the Protector-General to engage in trade. However Princess Jiaohe was actually the daughter of
Ashina Huaidao, and the Protector-General retorted: "How can an Ashina woman proclaim a decree to me, a military commissioner?!" In response Suluk attacked Qiuci. In 727 and 728 the Tibetan Empire attacked Qiuci. In 737 the Tibetan Empire conquered Lesser Bolü. In 741 the Tibetan Empire sacked the Stone City. In 745 the Tang general
Huangfu Weiming attacked the Stone City but suffered a major defeat. According to Huangfu, the Stone City was one of the most heavily defended bastions of the Tibetan Empire, In 747 the Tang general
Gao Xianzhi captured Lesser Bolü. In 748 the Tang recaptured Suiye and destroyed it. In 749 Tang recovered the Stone City. In 750 the Tang intervened in a dispute between their vassal Fergana and the neighboring kingdom of Chach, located in modern
Tashkent. The kingdom of Chach was sacked and their king was taken back to Chang'an, where he was executed. In the same year Tang also defeated Qieshi in
Chitral and the Turgesh. In 751 Tang forces suffered a major defeat at the
Battle of Talas against
Abbasid and
Karluk forces. Although the Battle of Talas saw the limit of Tang expansion to the west, the importance of the defeat at the Battle of Talas has sometimes been exaggerated. Although the Tang army was defeated, the Arabs did not extend their influence into Xinjiang, and the Karluks remained amiable to the Tang. Some Karluks converted to Islam, but the vast majority did not until the mid 10th century under
Sultan Satuq Bughra Khan of the
Kara-Khanid Khanate. The long-term strategic importance of Talas was overshadowed later on by the An Lushan Rebellion, which devastated the Tang homeland. It is now understood as the primary cause for the Tang retreat from Central Asia. In 754 Tang forces defeated
Baltistan (Greater Bolü) and Tibetan forces. In 755 the
An Lushan Rebellion occurred and the Tang dynasty withdrew 200,000 soldiers from the Western Regions to protect the capital. In 763 the Tibetan Empire conquered Yanqi. In the same year the Tang capital was briefly taken by the Tibetans before they were forced to retreat. painting, 8th–9th century CE. In 764 the Tibetan Empire invaded the
Hexi Corridor and conquered
Liang Prefecture, cutting off the Anxi and Beiting protectorates from the Tang dynasty. However Anxi and Beiting were left relatively unmolested under the leadership of Guo Xin and Li Yuanzhong. In 780 Guo Xin and Li Yuanzhong were officially made protectorate generals after sending secret messages to
Emperor Dezong of Tang. In 787 the Tibetan Empire conquered Qiuci. In 789 the monk
Wukong passed through Shule, Yutian, Gumo, Qiuci, Yanqi, and Ting Prefecture and found that they all had Chinese commanders and were free from Tibetan or Uyghur control. This contradicts the previous conquests of Yanqi and Qiuci by the Tibetan Empire in 763 and 787, assertions made by Yuri Bregel in his
An Historical Atlas of Central Asia. In 792 the Tibetan Empire conquered Yutian. It is unclear what happened to Shule (
Kashgar), Shache (
Yarkand), or Gumo (
Aksu). According to O. Pritsak, Kashgar came under
Karluk domination around this time, but this is disputed by Christopher I. Beckwith. ==Post-Tibetan domination==