Soon, however, with Zheng in desperate straits, Wang sought aid from Dou. Dou, believing that if Tang destroyed Zheng that his own Xia state would be cornered, agreed, and he sent his forward troops first while proceeding with his main troops later. In the engagement with Dou's forward troops, Li Shimin had Li Shiji, Chen Zhijie (), and Qin Shubao lead the troops, and they were able to defeat Dou's forward troops. Li Shimin then wrote Dou to persuade him to stop aiding Zheng, but Dou did not relent. In summer 621, Li Shimin engaged Dou at the Battle of Hulao, defeating and capturing him. Wang, believing further resistance to be futile, surrendered. Li Shimin spared Wang, but put a number of Zheng officials that he considered treacherous to death. Li Shiji's sworn brother Shan Xiongxin, whom Li Shimin considered treacherous because Shan had turned against Li Mi, was set to be executed as well. Li Shiji begged Li Shimin to spare Shan, arguing that Shan was a capable general who could be useful to Tang and offering to surrender all of his own honors to save Shan from death. Li Shimin refused. When Shan invoked the pledge they made to die on the same day, however, Li Shiji stated to him that he had already offered his body to the service of the state and that the body was no longer his—and that, if he died as well, no one would be around to take care of Shan's wife and children—therefore refused to die as well, but cut off a piece of his leg muscle, cooked it, and had Shan eat it, stating, "Let my flesh turn to dust along with you, my brother. By this, I can at least fulfill part of the pledge." Later that year, when Li Shimin returned to Chang'an, and Emperor Gaozu let his troops march in succession in great honor, Li Shiji was one of the 25 generals honored, permitted to wear the same golden armor that Li Shimin was clad in and to offer the captives at Tang's imperial ancestral temple. He was also united with his father Li Gai, who managed to survive the collapse of the Xia regime and return to Tang territory.