Shilian to Chang'an to show submission to Tang; Emperor Gaozu in turn sent Qiu He's sons Qiu Shili (丘師利) to Jiaozhi to accept his submission. Li Shimin, who was then the Prince of Qin and a major general under his father, retained Gao to serve on his staff as part of the government for the capital prefecture Yong Prefecture (雍州), of which he was prefect. As Gao was Princess Zhangsun's uncle, Li Shimin respected and trusted him. By 626, Li Shimin was locked in an intense rivalry with his older brother Li Jiancheng the Crown Prince, and he feared that Li Jiancheng would kill him. Gao and his nephew Zhangsun Wuji both suggested Li Shimin to act first, and Li Shimin agreed. In summer 626, he laid an ambush for Li Jiancheng and another brother who supported Li Jiancheng, Li Yuanji the Prince of Qi, killing them at Xuanwu Gate. Gao participated in leading part of Li Shimin's personal guards against the guards of Li Jiancheng and Li Yuanji in the aftermaths. After Li Shimin's victory, he effectively forced Emperor Gaozu to create him crown prince. Gao was made an honored advisor to Li Shimin, and soon was made the Shizhong (侍中) -- the head of the examination bureau of the government (門下省, Menxia Sheng) and a post considered one for a chancellor. Two months later, Emperor Gaozu yielded the throne to Li Shimin (as Emperor Taizong). During Emperor Taizong's reign Later in 626, when Eastern Tujue's Jiali Khan Ashina Duobi launched a major incursion into Tang territory, reaching all the way to Chang'an, Gao Shilian, along with Fang Xuanling, attended to Emperor Taizong as he personally met Ashina Duobi to promise additional tributes, to induce Ashina Duobi to withdraw. In 627, Emperor Taizong created Gao the Duke of Yixing. Later in 627, there was an incident in which Gao Shilian's deputy, Wang Gui, had written a secret petition to Emperor Taizong and, per protocol, submitted it first to Gao and requested that Gao attach it to his own submission to Emperor Taizong. Gao, however, held onto Wang's petition and did not submit it, and also did not inform Wang that he did so. When Emperor Taizong found out about this, he demoted Gao to the post of commandant at An Prefecture (安州, roughly modern Xiaogan, Hubei). Gao was later made the secretary general of Yi Prefecture (益州, roughly modern