Zhenzhu died in the fall of 645. Both Yemang and Bazhuo attended the funeral. It was said that Yemang was violent and disturbed, and also had a bad relationship with Bazhuo. After the funeral, Yemang, fearing that Bazhuo would harm him, left suddenly to return to the eastern part of the khanate. Bazhuo chased him down and killed him, and then took the throne with the title of Jialijulixueshaduomi Khan (or Duomi Khan for short). Duomi Khan, after he took the throne, decided to attack
China's
Tang dynasty, believing that with Emperor Taizong on a campaign against
Goguryeo, that the Tang borders would be undefended. However, Taizong, anticipating the possibility of a Xueyantuo attack, had had the general Zhishi Sili (執失思力) command
Göktürk soldiers to defend Xia Prefecture (夏州, roughly modern
Yulin,
Shaanxi). Once Duomi attacked,
Zhishi Sili and another general, Tian Renhui (田仁會), set a trap to induce Duomi to attack Xia Prefecture, and defeated him once he was at Xia Prefecture. Duomi withdrew, but soon attacked Xia Prefecture again. Briefly after new year 646, Taizong ordered, in addition to Zhishi and Tian's troops, for troops to be mobilized under the generals
Li Daozong, Xue Wanche (薛萬徹), Ashina She'er (阿史那社爾), Song Junming (宋君明), and Xue Guwu (薛孤吳), to defend against Duomi's attack, which Duomi called off after reaching the
Great Wall and realizing that Tang forces had been mobilized. In turn, in the spring of 646, Zhishi and Qiao Shiwang (喬師望) counterattacked, defeating Duomi and forcing him to flee, throwing the Xueyantuo into a state of confusion. Meanwhile, it was said that Duomi was intolerant and ill-tempered, as well as suspicious. He removed Zhenzhu's chief advisors and replaced them with people close to him, which led to the nobles despising him—and he responded by killing a large number of them, throwing the Xueyantuo court into terror. Yaoluoge Tumidu (藥羅葛吐迷度), the chieftain of the
Uyghurs, a Xueyantuo's vassal tribe, rebelled along with the Pugu (僕骨) and
Tongluo (同羅) tribes and dealt Duomi a great defeat. Taizong took the chance to order a major assault against Xueyantuo proper by Li, Ashina, Zhishi, Qibi Heli (契苾何力), Xue Wanche, and Zhang Jian (張儉). As the assault was beginning, by chance a Tang officer, Yuwen Fa (宇文法), was serving as an emissary to the Wuluohu (烏羅護) and the
Mohe and returning toward Tang, when he encountered the Xueyantuo general Abo (阿波). Yuwen attacked Abo with the Mohe troops with him at the time and defeated Abo—which led to even greater confusion for the Xueyantuo, whose people believed that the main Tang army had already arrived. In panic, Duomi fled to the vassal
Ashide (阿史德) tribe, and when Uygher forces heard this, they attacked and killed Duomi, killing any Xueyantuo imperial clan members they could find. The Uyghers took over most of the Xueyantuo's territory, while many Xueyantuo generals surrendered to the Tang. Duomi's cousin
Duomozhi tried to revive the Xueyantuo fortunes, but soon surrendered to the Tang, ending the Xueyantuo as a khanate. == See also ==