general. When Zhang engaged khagan, however, he suffered a major defeat, and Wen was captured. As Wen was an important official, khagan put him under interrogation and asked him about the strengths and weaknesses of the Tang state. Wen refused to answer and khagan moved him to the Yin Mountains region. In 626, just 19 days after Emperor Taizong took the throne, Shibobi and Illig were just across the Wei River from Chang'an. Emperor Taizong, accompanied by Gao Shilian and Fang Xuanling, was forced to meet Tujue across the river and personally negotiate peace terms, including tributes to Eastern Turks, before Illig withdrew. Civil war In 627 he attempted to levy horses from the vassal Tiele tribes after all his livestock died from a snowstorm. The Tiele revolted under a Xueyantuo coalition. Emperor Taizong of Tang wasted no time in allying with these Tiele and the Khitans in a joint attack. Illig was already facing internal dissent from the Göktürk generals jealous of the influence of Illig's Sogdian viziers. As response, khagan gave 100,000 cavalry to the command of Yukuk Shad to suppress revolts. However shad was defeated by Huige forces commanded by Pusa (菩薩) near Malie (near modern Gansu). Later, more generals of Tujue were defeated by the Xueyantuo. In 628 Kumo Xi tribes also rose in rebellion against Tujue. Eastern governor Ashina Shibobi was unsuccessful in defeating rebels, which made khagan angry and ordered him to be flogged and imprisoned for 10 days. Taizong used this opportunity to invite him to flee to Tang. End of reign In summer 628, when a number of Khitan tribes surrendered to Tang, Illig offered to trade Liang Shidu for the Khitan tribes, but Emperor Taizong refused stating Liang was already on verge of surrendering himself and Khitan were no Turk. Meanwhile, Emperor Taizong sent his brother-in-law Chai Shao (柴紹) and the generals Xue Wanjun (薛萬均), Liu Lancheng (劉蘭成), and Liu Min (Liang's former subordinate) to pressure Shuofang. They soon defeated Eastern Tujue forces and put Shuofang under siege, and Eastern Tujue forces were unable to lift the siege. When the food supplies ran out, Liang Shidu's cousin Liang Luoren assassinated Liang Shidu and surrendered the city to Tang Around the new year 630, with Eastern Tujue in internal turmoil, khagan attacked Ashina Shibobi (阿史那什鉢苾). As a reaction Emperor Taizong commissioned Li Jing, Li Shiji, Wei Xiaojie, Li Daozong, Chai Shao (柴紹),