[4] There, Li Shimin established himself and appointed about fifty civil and military officials, which made it possible for him to challenge the heir apparent's pre-eminence.
[5] Prince Li Shimin found himself unable to gain support in the capital Chang'an or inside the imperial palaces, as he was often away on military expeditions.
[5] There were allegations that Yang Wengan was raising troops for Li Jiancheng, who was left in charge of the capital while Emperor Gaozu was away in his summer palace, to stage a coup for the throne.
[7] Emperor Gaozu sent Li Shimin to put down the rebellion, but Yang Wengan's own subordinates killed him after the imperial forces arrived at the scene.
[6] Emperor Gaozu initially offered Li Shimin the position of heir apparent in light of Yang Wengan's rebellion.
[9] According to the Jiu Tangshu, it happened prior to 626, while the Zizhi Tongjian dates it to the sixth lunar month of 626, placing it within three days of the coup.
[6] By 626, Li Shimin became increasingly worried by his brothers' successful machinations in turning Emperor Gaozu against him and in removing his staff members.
[10] Li Shimin decided to take action and planned to dispose of his two brothers at the advice of his subordinates, especially Zhangsun Wuji, Fang Xuanling, Du Ruhui, Yuchi Jingde, and Hou Junji.
[13] After being summoned in secrecy, Fang Xuanling and Du Ruhui disguised themselves as Taoist priests and traveled to Li Shimin's camp to discuss the strategy.
[13] The emperor also requested for his personal advisors Pei Ji, Xiao Yu, Chen Shuda, Feng Lun, and Yan Shigu to come.
[14] Li Yuanji opted to not attend the imperial court that morning, but to excuse themselves due to "illness" to prepare the troops and observe the situation.
[17] Chang He, a military officer stationed at Xuanwu Gate, led his troops in support of Li Shimin on the day of the coup.
[19] Emperor Gaozu was sailing on a lake inside the Palace City during the time of the coup according to the Jiu Tangshu and Zizhi Tongjian.
[19] The officials with the emperor were Pei Ji, Xiao Yu, Chen Shuda, Feng Lun, Yan Shigu, Dou Dan, and Yuwen Shiji.
[13] During the ongoing battle, according to the Jiu Tangshu and Zizhi Tongjian, Li Shimin sent Yuchi Jingde fully armed into the Palace City to announce the news of the situation to Emperor Gaozu.
[22] As described in the text, two of them completely exonerated Li Shimin and spoke highly meritoriously of him, said that the killings of the two princely brothers served as a punishment, and recommended Emperor Gaozu to appoint him as the heir apparent.
[22] At Yuchi Jingde's advice, Emperor Gaozu issued an imperial edict ordering the remaining forces to stop their resistance and submit to Li Shimin.
[20] In 632, Ma Zhou charged that the retired Emperor Gaozu had settled in the Da'an Palace,[i] which he considered an inhospitable place as it was built on low-lying lands at Chang'an that were plagued by dampness and heat during the summer.