The Tang offensive launched in the winter of 629, led by General Li Jing; the Khaganate was destroyed following Illig Qaghan's capture in 630.
Initially, the Tang attempted to settle the Eastern Turks within its borders, and left the territory north of the empire to the Xueyantuo.
Furthermore, the Khaganate continued to support Liang Shidu (the last competing Chinese claimant to Tang), and harbour Prince Yang Zhengdao and his grandmother Empress Xiao of Sui.
Li Shimin, the Prince of Qin and future Emperor Taizong, convinced Gaozu to abandon the proposal by promising to - eventually - defeat the Eastern Turks.
Less than a month after Taizong took the throne, a Khaganate raid - led by Illig Qaghan and Ashina Shibobi - began that eventually reached Chang'an.
Khaganate government functions were entrusted to Zhao Deyan (趙德言), from China, whose corruption and complicated regulations alienated the population.
Furthermore, Illig Qaghan favoured ethnic Xiongnu[citation needed] over Eastern Turks, leading to rebellions and their suppression.
Another source says that Illig Qaghan's problems were caused by two unusually cold winters that led to mass livestock deaths and famine.
Illig Qaghan fled to subordinate khan Ashina Sunishi (阿史那蘇尼失); Princess Yicheng of Sui, his wife, was killed.
Illig Qaghan was soon captured by the Tang generals Li Daozong and Zhang Baoxiang (張寶相) and delivered to Chang'an.
The population surrendered to the Tang or Xueyantuo, or fled west to the Western Turkic Khaganate and the nearby kingdoms such as Qocho, Kucha and Tuyuhun.
The Khaganate's former vassals of the Khitan, Xī (奚), and Xí (霫) tribes directly submitted to the Tang, as did the city kingdom of Yiwu (伊吾).
On 19 May 639,[4] they hid outside Taizong's palace, intending to charge inside at dawn when the gates opened to allow Li Zhi, the Prince of Jin, to leave.
However, Li Zhi did not leave early because of strong winds, so Ashina Jiesheshuai attacked the gate rather than risk discovery after dawn.
On 13 August 639,[5] Taizong ordered the resettlement of Eastern Turks and Xiongnu north of the Yellow River between the Great Wall and the Gobi Desert.
The Eastern Turks feared the Xueyantuo and initially refused; Taizong responded by issuing an edict to Yi'nan, delivered by official Guo Siben (郭嗣本), stating: After Jiali Khan was defeated, his tribes all surrendered to me.
If you exceed your boundaries and attack each other, I will send troops to punish you both.Yi'nan was unhappy with the Eastern Turkic Khaganate's reestablishment but signalled compliance.
The Eastern Turks remained willing to follow Ashina Simo north, and the Khaganate was reestablished as a Tang vassal.
Ashina Simo requested, and received, permission from Taizong to withdraw south of the Great Wall should the fledgling Khaganate be attacked by the stronger Xueyantuo.
In winter 641[clarification needed], Yi'nan believed that the ritual journey to Mount Tai by Taizong and the Tang army presented an opportunity to quickly destroy the Khaganate.
An Xueyantuo army was deployed to attack Khaganate; it was led by Dadu (大度), Yi'nan's son, and also included troops conscripted from the vassal Tiele tribes of the Bayegu (拔也古), Tongluo (同羅), Pugu (僕骨), Uyghurs (回纥), Adie (阿跌), and Xí (霫).
An anticipated, Ashina Simo was forced to withdraw behind the Great Wall to Shuo Prefecture (朔州, roughly modern Shuozhou, Shanxi) and seek emergency aid.
The Xueyantuo continued to harass the Khaganate, while attempting to maintain peaceful relations with the Tang; at one point Yi'nan was engaged to Taizong's daughter Princess Xinxing, but Taizong regretted the arrangement and cancelled the marriage in 643 on the pretense that Yi'nan's bride price (with livestock) was not paid for on time.
More Tang emissaries were sent to order the Xueyantuo to stop attacking the Khaganate, to which Yi'nan: How do I not dare to follow the emperor's edict?
I am willing to kill the Turks for China.Around the new year 645, the Khaganate collapsed; apparently its population was pressured by the Xueyantuo to abandon Ashina Simo.
In In spring 649, Taizong sent an army of Uyghurs and Pugu (僕骨) troops, led by General Gao Kan (高侃), against Ashina Hubo.