Bazhuo, after he took the throne, decided to attack China's Tang Dynasty, believing that with Emperor Taizong then on a campaign against Goguryeo, that Tang borders would be undefended. However, Emperor Taizong, anticipating the possibility of a Xueyantuo attack, had had the general Zhishi Sili (執失思力) command Tujue soldiers to defend Xia Prefecture (夏州, roughly modern Yulin, Shaanxi). Once Bazhuo attacked, Zhishi Sili and another general, Tian Renhui (田仁會), set a trap to induce Bazhuo to attack Xia Prefecture, and dealt him a defeat once he was at Xia Prefecture. Bazhuo withdrew, but soon attacked Xia Prefecture again. Briefly after new year 646, Emperor Taizong ordered, in addition to Zhishi and Tian's troops, for troops to be mobilized under the generals Li Daozong the Prince of Jiangxia, Xue Wanche (薛萬徹), Ashina She'er (阿史那社爾), Song Junming (宋君明), and Xue Guwu (薛孤吳), to defend against Bazhuo's attack, which Bazhuo called off after reaching the Great Wall and realizing that Tang forces had been mobilized. In turn, in spring 646, Zhishi and Qiao Shiwang (喬師望) counterattacked, defeating Bazhuo and forcing him to flee, throwing Xueyantuo into a state of confusion.
Meanwhile, it was said that Bazhuo was intolerant and ill-tempered, as well as suspicious. He removed Yi'nan'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 Xueyantuo's vassal tribe Huige, rebelled along with the Pugu (僕骨) and Tongluo (同羅) tribes and dealt Bazhuo a great defeat. Emperor 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 Xueyantuo, whose people believed that the main Tang army had already arrived. In panic, Bazhuo fled to the vassal Ashide (阿史德) tribe, and when Huige forces heard this, they attacked and killed Bazhuo, slaughtering the Xueyantuo imperial clan members that they could find. The Huige took over most of Xueyantuo territory, while many Xueyantuo generals surrendered to Tang. Bazhuo's cousin Duomozhi tried to revive Xueyantuo fortunes, but soon surrendered to Tang, ending Xueyantuo as a khanate.
