In 626, Li Shimin, then in an intense rivalry with his older brother Li Jiancheng the Crown Prince and fearful that Li Jiancheng was about to kill him, ambushed Li Jiancheng and another brother, Li Yuanji the Prince of Qi, who supported Li Jiancheng, at Xuanwu Gate and killed them. He then effectively forced Emperor Gaozu to create him crown prince and then yield the throne to him (as Emperor Taizong). He recalled Li Daozong from Ling Prefecture, first to serve as the director of vassal affairs, and then as the chief judge of the supreme court. Later on, when Emperor Taizong was planning to attack Eastern Tujue, he again made Li Daozong the commandant at Ling Prefecture. In 630, when the general Li Jing launched the attack on Eastern Tujue, Li Daozong served under him, and eventually participated in the capture of Eastern Tujue's Jiali Khan Ashina Duobi, with Li Daozong's assistant Zhang Baoxiang () carrying out the actual capture. Upon return, Emperor Taizong increased Li Daozong's fief by 600 households and made him the minister of justice.