In 646, with Xueyantuo in internal turmoil due to the cruelty of the Duomi Khan Bazhuo (Yi'nan's son), Emperor Taizong sent Li Daozong to launch a major attack on Xueyantuo, defeating Xueyantuo forces. Bazhuo fled, but was then attacked and killed by Huige, which took over Xueyantuo territory. Xueyantuo's remaining forces supported Yi'nan's nephew Duomozhi as Yitewushi Khan. Duomozhi offered to submit, but Emperor Taizong, fearful that Xueyantuo might recover and create more trouble later on, sent Li Shiji with an army toward Duomozhi's location. Duomozhi surrendered, and Li attacked the remaining forces unwilling to submit, defeating and capturing them. He delivered Duomozhi to Chang'an, where Emperor Taizong made Duomozhi a general.