Li Yuanji
Later in Emperor Gaozu's reign, Li Shimin was locked in an intense rivalry with his older brother Li Jiancheng the Crown Prince, and Fang and Du often suggested that he act first against Li Jiancheng. As both Li Jiancheng and another brother who supported Li Jiancheng, Li Yuanji the Prince of Qi, feared Fang's and Du's strategic capabilities, they falsely accused both Fang and Du and had them demoted out of Li Shimin's staff. In summer 626, when Li Shimin decided to act against Li Jiancheng and Li Yuanji, however, he summoned Fang and Du to his mansion. Fang and Du, initially fearing Emperor Gaozu's orders forbidding them to serve Li Shimin, declined. In anger, Li Shimin sent the general Yuchi Gong to summon Fang and Du, with directions that if they declined again, to kill them. Yuchi, however, was able to persuade them that Li Shimin was in fact intending on acting against Li Jiancheng and Li Yuanji, and so Fang and Du put on disguises as Taoist monks and were able to get to Li Shimin's mansions, where they assisted Li Shimin in planning the ambush against Li Jiancheng and Li Yuanji. Li Shimin subsequently ambushed his brothers at Xuanwu Gate and killed them, and then effectively forced Emperor Gaozu to create him crown prince. Once he was created crown prince, Fang and Du were restored to honored positions on his staff, and soon, Du was made the minister of defense. Two months later, Emperor Gaozu yielded the throne to Li Shimin (as Emperor Taizong).