In 642 AD, the Tang government appointed the grandson of Nishu Khan, Yipishekui, as the Khan of the Western Turks, so as to control, through him, the northern and western parts of the Western Regions. But Yipishekui was thinking about limiting the Tang influence to the east of the Western Regions. He gained control of Yanqi through a marriage between his subordinate and Yanqi princess, and then obstructed transport and harassed Xizhou. The Tang troops defeated Yanqi in 644 AD (the 18th year of Zhenguan reign), but without effective occupation. In 648 AD, the Tang government sent out troops again, which were still a coalition of the Han and minority people, the latter constituting the main force. The commander was a surrendered Turk, Right General Ashina Sher. Composed by 13 divisions of Teli troops, over 100,000 Turks and the Han troops from the Central Plains, Yizhou and Xizhou, the Tang army first captured Yanqi, then attacked Qiuci. Ashina Helu and Quliqo from the Western Turks surrendered to the Tang troops. Then the Tang army went south, where the king of Yutian also surrendered. The Tang government made the newly surrendered Kunshan Route General Supervisor and Left General, Ashina Helu, a Yabgou (or deputy king) and continued the expedition. The Western Turks thus stopped fighting and pledged allegiance one after another, and the western expedition was a complete success. The military operations aimed at unifying the Western Regions came to a temporary stop.
In the aftermath of the victory, the Tang government set up four military garrison commands in the Western Regions, Sulek(also known as Shule), Qiuci, Yutian and Yanqi (changed to Suiye, or Suyab, between 679 AD and 719 AD), which were all under the control of the Protector of Anxi.
Historically, they were known as the“Four Garrison Commands of Anxi”. The installation of the Office of Protector of Anxi and the Four Garrison Commands of Anxi was an important step in the Tang Dynasty’s rule over the Western Regions, In terms of post installation, while inheriting governance strategies of previous dynasties, the Tang government invented some new measures in its administration Gran muralla, mutianyu y badaling en china in the Western Regions, which can be summed up as follows:
(1) Continued combination of military and administrative functions in the governance system. Since its creation in the Han Dynasty, the Protector system combining military and administrative
functions was picked up by all the following dynasties, which produced rather good results. This showed that this governance system was basically compliant with the economic and social development in the Western Regions at that time.