Li Jiancheng (; 589 – July 2, 626), posthumous name Crown Prince Yin (隱太子), childhood nickname Vaishravana (毗沙門),New Book of Tang vol. 79, section "Crown Prince Yin" text: " was the first crown prince of the Chinese Tang dynasty. He was the oldest son of the founding emperor Emperor Gaozu (Li Yuan) and the crown prince after the founding of the dynasty in 618 CE.

Li Jiancheng was murdered by his younger brother, Tang general Li Shimin, the Prince of Qin, in the Xuanwu Gate Incident on July 2 626,The date of the Xuanwu Gate Incident was the 4th day of the 6th month of the 9th year of the Wude era, which translates to 2 July 626 in the Julian calendar, according to the Academia Sinica.. in which Li Shimin seized control of the imperial government and forced their father Emperor Gaozu to abdicate. Li Jiancheng's sons were subsequently executed or excluded from the imperial clan. After Li Shimin took the throne, Li Jiancheng was posthumously stripped of his crown prince status and granted the title "Prince Yin of Xi" (). Later, he was buried with the ceremonies due to an imperial prince. On 9 July 642,() Jiu Tang Shu, vol.03 Li Jiancheng's title of crown prince was restored; his posthumous name then became Crown Prince Yin ().

Background Li Jiancheng was born in 589 during the reign of Emperor Wen of Sui. He was the oldest son of Li Yuan, then Duke of Tang, who was a hereditary noble, and Li Yuan's wife Duchess Dou, who was the daughter of Dou Yi (), the Duke of Shenwu and Northern Zhou's Princess Xiangyang. Duchess Dou would subsequently give birth to three of Li Jiancheng's younger brothers: Li Shimin, Li Xuanba (, who died in 614), and Li Yuanji. She also gave birth to a girl who eventually became Princess Pingyang, although it is not clear whether she was older or younger than Li Jiancheng. At some point, Li Jiancheng received the title of Heir apparent of Tang.On 20 December 617, Li Jiancheng was made crown prince of the princedom of Tang. () Jiu Tang Shu, vol.01

Participation in Tang's founding

The rebellion against Sui rule In 616, with rebellions beginning to engulf northern China and frequent Eastern Tujue incursions across the border, Emperor Yang of Sui commissioned Li Yuan to be the commander of Taiyuan, guarding it against both rebels and the Eastern Tujue. As the chief commander of Taiyuan, Li Yuan was obligated by law to leave his family behind. Li Jiancheng was therefore put in charge of the estate and became the head of the house of Hedong (, in modern Yuncheng, Shanxi) while Li Yuan was away.New Book of Tang, Scroll 79 ( Li Yuan took his younger son Li Shimin with him to the city Jinyang, which was the administrative center of Taiyuan.

According to the traditional narrative in the official historical records, in 617 Li Yuan was persuaded by Li Shimin to rebel against Sui rule (see "Historical sources" below). Another source, Wen Daya's () Da Tang Chuangye Qijuzhu (), attributes the decision to revolt to Li Yuan himself.Wen Daya (), Da Tang chuangye qiju zhu () (ca. 626; Shanghai: Shanghai guji publishing house, 1983), 1.2. When Li Yuan was initially assigned to Jinyang in 616, he was pleased and regarded his assignment as a divinely-granted opportunity.Wen Daya (), Da Tang chuangye qiju zhu ( But just one year later, in 617, Li Yuan said to Li Shimin: "The Sui Empire is about to collapse and the next family to rule this country will be us. The only reason I haven't yet started a rebellion is because your brothers are still in Hedong".Wen Daya (), Da Tang chuangye qiju zhu ( Li Yuan sent secret messengers to Hedong to transfer his family to Jinyang. During the journey one of Li Jiancheng's younger brothers, Li Zhiyun, died. He also summoned his son-in-law Chai Shao from Chang'an. At the urging of Li Yuan's daughter, Chai Shao left Chang'an on his own while she went into hiding.

Even before Li Jiancheng, Li Yuanji, and Chai Shao arrived at Jinyang, Li Yuan rebelled, declaring that he intended to support Emperor Yang's grandson Yang You, the Prince of Dai, as emperor, while honoring Emperor Yang as Taishang Huang (retired emperor). Yang You was nominally in charge of the capital city Chang'an at the time.

Li Yuan made both Li Jiancheng and Li Shimin key generals, and in nine days they captured Xihe Commandery (, roughly modern Lüliang, Shanxi), impressing their father. Subsequently, Li Yuan divided his forces into six armies, giving Li Jiancheng and Li Shimin command of three armies each. He also made Li Jiancheng the Duke of Longxi and Li Shimin the Duke of Dunhuang. Li Yuan then advanced toward Chang'an. As he approached Hedong, torrential rains prevented his army from advancing further. With rumors running rampant that Liu Wuzhou and the Eastern Tujue were about to attack Taiyuan, Li Yuan initially ordered a retreat back to Taiyuan. However, Li Jiancheng and Li Shimin argued that this would mean sure defeat, and Li Yuan changed his mind.

Li Jiancheng and Li Shimin then captured the fortress of Huoyi (, in modern Linfen, Shanxi), eventually convincing Li Yuan to bypass Hedong and directly advance toward Chang'an. After he crossed the Yellow River into Guanzhong (i.e., the Chang'an region), he sent Li Jiancheng with Liu Wenjing () east to guard Tong Pass and Yongfeng Storage () and to stop any potential Sui reinforcements from the eastern capital Luoyang. He also sent Li Shimin north of the Wei River to seize territory. Once Li Yuan himself approached Chang'an, he summoned both Li Jiancheng and Li Shimin to join him in a siege of Chang'an. On 19 December 617, Li Yuan captured Chang'an and declared Yang You emperor (as Emperor Gong).() Jiu Tang Shu, vol.01 He was created Prince of Tang on 20 December, and became the regent for Yang You.

In the spring of 618, Li Yuan sent Li Jiancheng and Li Shimin toward Luoyang, which was then under attack by the rebel leader Li Mi, Duke of Wei, ostensibly to help the Sui forces there. The Sui forces rejected the overture, and Li Jiancheng and Li Shimin returned to Chang'an.

Tang imperial reunification Later in the spring of 618, Emperor Yang, then at Jiangdu (, in modern Yangzhou, Jiangsu), was killed in a coup led by the general Yuwen Huaji. When this news arrived at Chang'an, Li Yuan had Yang You yield the throne to him. He established the Tang dynasty, and declared himself emperor. He also made Li Jiancheng crown prince on 4 July.() Jiu Tang Shu, vol.01

In 619, Li Yuan sent Li Jiancheng to attack the peasant rebel leader Zhu Shanhai (), the Duke of Huxiang. Li Jiancheng defeated Zhu. Later that year Li Gui, the Emperor of Liang, was captured in a coup by his official An Xinggui (), who then surrendered to Tang. Li Yuan sent Li Jiancheng to welcome An and to escort Li Gui to Chang'an, where An was executed by Li Yuan.

Meanwhile, Li Jiancheng was developing a reputation for leniency but was addicted to drinking and hunting. Li Yuan was worried that he was ignorant about politics and uninterested in working for the state. He added his key ministers Li Gang () and Zheng Shanguo () to Li Jiancheng's staff.

Campaigns against Tujue On July 1, 620, Li Shimin was sent to fight Wang Shichong. In the fall of 620, reports came in that Li Zhongwen (), who was then in charge at Taiyuan, was planning to rebel. Li Yuan sent Li Jiancheng to Pufan (, i.e., Hedong) to guard against Li Zhongwen, while summoning Li Zhongwen back to the capital. Li Zhongwen complied and was later executed.

In spring 621 the Xiongnu chieftain Liu Xiancheng () harassed Tang's border territory. Li Yuan sent Li Jiancheng to attack Liu. Li Jiancheng captured a number of the Xiongnu and released their leaders. This led them to surrender in large numbers, and he then massacred them. Only Liu escaped and fled to Liang Shidu, the Emperor of Liang. In 622, Li Jiancheng was one of the commanders that Li Yuan sent, along with Li Shimin, Li Zihe (), and Duan Decao (), to counter an Eastern Tujue incursion.

Rivalry with Li Shimin Meanwhile, an intense rivalry had developed between Li Jiancheng and Li Shimin, who now carried the title Prince of Qin. Although Li Jiancheng had made contributions towards Tang's reunification of China, Li Shimin had defeated a number of the most important contenders including Xue Rengao, the Emperor of Qin, Wang Shichong, the Emperor of Zheng, and Dou Jiande, the Prince of Xia. Li Shimin therefore had a stronger reputation in the army. Li Yuanji was also often relied on by Li Yuan as a general and had been created the Prince of Qi. He supported Li Jiancheng in his rivalry with Li Shimin, and often pushed Li Jiancheng toward a more hard-line position, wanting to be crown prince when Li Jiancheng became emperor. Li Jiancheng and Li Yuanji had better relations with Li Yuan's favored young concubines than Li Shimin did (their mother Duchess Dou had died before Tang's establishment), and those concubines helped rehabilitate Li Jiancheng's standing before Li Yuan. Li Yuan had considered making Li Shimin crown prince instead of Li Jiancheng, but his concubines persuaded him not to.

By winter 622, the only remaining major threat against Tang rule was Liu Heita, the Prince of Handong. He had been a Xia general, and rose against Tang after Li Yuan had executed Dou Jiande. He had been defeated by Li Shimin earlier in the year. Li Jiancheng's staff members Wang Gui and Wei Zheng argued to him that he needed some victories to establish his reputation, and Li Jiancheng volunteered to command the army against Liu Heita. Li Yuan sent Li Jiancheng to attack Liu, assisted by Li Yuanji. Around the turn of the year, Liu's forces were bogged down while attacking Tang's Wei Prefecture (, in modern Handan, Hebei). Li Jiancheng and Li Yuanji engaged him at Guantao, crushing him. Liu fled north toward the Eastern Tujue, but was ambushed and captured by his own official Zhuge Dewei (), who delivered him to Li Jiancheng. Li Jiancheng executed Liu. China was by this point almost completely unified by Tang.

In 623, when the Eastern Tujue made another incursion into Tang territory, Li Yuan again sent Li Jiancheng and Li Shimin to guard against the attack. Meanwhile, Li Yuanji suggested to Li Jiancheng that he could have Li Shimin assassinated when Li Shimin was visiting Li Yuanji's mansion, but Li Jiancheng refused, not having the heart to kill a brother.