Taizong's wife Empress Zhangsun. In 631, he was created the Prince of Jin. In 633, he was made commandant of Bing Prefecture (并州, roughly modern Taiyuan, Shanxi), but remained at the capital Chang'an rather than reporting to Bing Prefecture. When Empress Zhangsun died in 636, Emperor Taizong was particularly touched by the grief that Li Zhi displayed, and from that point on particularly favored him. Sometime while he was the Prince of Jin, at the recommendation of his grand aunt Princess Tong'an, he married the grandniece of Princess Tong'an's husband Wang Yu () as his wife and princess. Meanwhile, Li Zhi's two older brothers by Empress Zhangsun, Li Chengqian the Crown Prince and Li Tai the Prince of Wei, were locked in an intense rivalry, as Li Tai was favored by Emperor Taizong for his talent and was trying to displace Li Chengqian. Li Chengqian, in fear, entered into a conspiracy with the general Hou Junji, his uncle Li Yuanchang () the Prince of Han, the imperial guard commander Li Anyan (), and his brothers-in-law Zhao Jie (趙節, who was also his cousin) and Du He () to overthrow Emperor Taizong. The plot was discovered in 643, and Emperor Taizong deposed Li Chengqian. He was initially going to make Li Tai the new crown prince, but later began to believe that Li Tai's machinations were responsible for Li Chengqian's downfall. The powerful chancellor Zhangsun Wuji – Empress Zhangsun's brother—suggested that he make Li Zhi crown prince, a possibility that Li Tai was apprehensive about. Li Tai tried to intimidate Li Zhi, who had been friendly with Li Yuanchang, by pointing out to Li Zhi that Li Yuanchang had been part of the plot and that he should be concerned for himself. When Emperor Taizong noticed Li Zhi worrying about this and was told by Li Zhi of Li Tai's intimidation, Emperor Taizong's mind became set. He exiled Li Tai, and on 30 April 643, he created Li Zhi the new crown prince. He made Zhangsun and two other senior chancellors, Fang Xuanling and Xiao Yu, senior advisors to Li Zhi, and made another chancellor, Li Shiji, the head of Li Zhi's household. At the advice of another key official, Liu Ji, who pointed out that the crown prince needed to have a group of well-learned scholars that he was close to, Emperor Taizong appointed Liu, as well as Cen Wenben,