Yuchi Gong () or Yuchi Rong () (585 – 25 December 658jiachen day of the 11th month of the 3rd year of the Xianqing era, per Emperor Gaozong's biography in volume 4 of Old Book of Tang. Yuchi's biography in volume 68 of Old Book of Tang indicated that he was 74 (by East Asian reckoning) when he died. Thus by calculation, his birth year should be 585.), courtesy name Jingde (), also known by his posthumous name Duke Zhongwu of E, was a Chinese military general who lived in the early Tang dynasty. Yuchi Jingde and another general Qin Shubao are worshipped as door gods in Chinese folk religion.

Naming dispute Yuchi's given name of "Gong" was only recorded in the New Book of Tang. His tomb was found at Liquan County in 1971. According to the epitaph, his name was Yuchi Rong and courtesy name was Jingde.

During Sui dynasty Yuchi Jingde was born in 585, during the reign of Emperor Wen of Sui. His surname was likely from Xianbei origin, and he was from Shuo Province (, roughly modern Shuozhou, Shanxi). When agrarian rebels rose against Sui rule near the end of the reign of Emperor Wen's son Emperor Yang, Yuchi initially served in the governmental militia fighting agrarian rebels, and was known and awarded for his bravery.

Service Under Liu Wuzhou When Liu Wuzhou rose against Sui rule in spring 617 at Mayi (, in modern Shuozhou), declaring himself Dingyang Khan, Yuchi Jingde joined Liu and was made a general. In 619, he served under Liu's major general Song Jingang () in attacking Tang dynasty territory to the south. Around the new year 620, Yuchi and another general under Song, Xun Xiang (), engaged the Tang general Li Xiaoji () the Prince of Yong'an (Emperor Gaozu of Tang's distant nephew), defeating Li Xiaoji and capturing not only him, but several other key Tang officials, including Emperor Gaozu's cousin Dugu Huai'en (), Yu Yun (), Tang Jian (), and Liu Shirang (). However, when Yuchi and Xun then engaged the forces under the major Tang general Li Shimin the Prince of Qin (Emperor Gaozu's son), they were defeated first by Yin Kaishan and Qin Shubao, and then Li Shimin himself, escaping just with their lives. Subsequently, at the suggestion of the captured Tang Jian, Yuchi released Liu Shirang in order to negotiate peace with Tang, but those negotiations appeared to go nowhere at the moment. In summer 620, after Li Shimin achieved further victories against Song, forcing Liu Wuzhou to flee, Li Shimin sent his cousin Li Daozong the Prince of Rencheng and Yuwen Shiji to persuaded Yuchi and Xun to surrender, and they did. Li Shimin, who was impressed by Yuchi's battle prowess, was happy about this development and put Yuchi, as well as the 8,000 soldiers who surrendered with him, directly under his own command, against the misgivings of the general Qutu Tong (), who feared that Yuchi was not truly submitting.

During Emperor Gaozu's reign

In 620, Yuchi Jingde was serving under Li Shimin in Li Shimin's campaigns against a major enemy for Tang, Wang Shichong the Emperor of Zheng. During the campaign, many of Yuchi's former confederates who served under Liu Wuzhou, including Xun Xiang, defected to Zheng. Li Shimin's subordinates thus suspected Yuchi as well and put him under house arrest. Qutu Tong and Yin Kaishan suggested that Yuchi be executed. Li Shimin pointed out that if Yuchi really wanted to defect, he would not have waited to do so after Xun's defection. Instead, he released Yuchi and took Yuchi into his own tent, stating, while giving him gold:) Jiu Tang Shu, vol.68

We are kindred spirits, and I hope you would not take this minor understanding to heart. I will not believe false, defamatory accusations to kill those who are good and faithful. You should understand my heart. If you really want to leave, this gold will serve as your traveling expenses, as a gift from the time that we served together.

Later that day, when Li Shimin was examining the battlefield, Zheng forces suddenly arrived and surrounded Li Shimin. The Zheng general Shan Xiongxin () directly attacked Li Shimin himself, and almost killing Li, Yuchi arrived and hit Shan with a spear, knocking Shan off his horse. Yuchi then escorted Li Shimin out of danger. Tang forces commanded by Qutu then counterattacked as well, defeating Zheng forces. Li Shimin awarded him a box of gold and silver and told him, "How does your repayment come so quickly!" Thereafter, he trusted Yuchi further. Meanwhile, Li Shimin's younger brother Li Yuanji the Prince of Qi, who was himself a ferocious warrior, heard that Yuchi had the particular skill of disarming opponents' lances, and requested a combat demonstration with Yuchi. Li Shimin ordered that they remove the sharp edges from their lances, but Yuchi responded, "I will obey the order and do so, but the Prince does not need to." Once they were into combat, Yuchi disarmed Li Yuanji three times. Li Yuanji was impressed but also angry from being humiliated. Meanwhile, Li Shimin selected some 1,000 elite soldiers, clad in black uniform and black armor, commanded by Li Shimin himself, to serve as the forward advance corps, with Yuchi, Qin Shubao, Cheng Zhijie, and Zhai Zhangsun () as his assistants. This corps subsequently accomplished much during the campaign against Wang and Dou Jiande the Prince of Xia, who came to Wang's aid. In engagement with Xia forward troops in spring 621, Yuchi was serving directly next to Li Shimin himself, and after they defeated Dou's forward troops, Li Shimin wrote to Dou, trying to dissuade him from aiding Zheng, but Dou did not relent.

In summer 621, the Tang and Xia forces, commanded by Li Shimin and Dou respectively, engaged at the Battle of Hulao. During the early stages of the battle, Wang Shichong's nephew Wang Wan () the Prince of Dai, whom Wang Shichong had sent to Xia to request aid, was on the battlefield showing off his handsome horse. Li Shimin made the comment, "What an impressive horse!" Yuchi requested that he be allowed to capture it for Li Shimin, but Li Shimin disallowed it, stating, "How can I lose a great warrior for a horse?" Yuchi did not relent, however, and he took Gao Zengsheng () and Liang Jianfang () with him; the three of them made a surprise attack into the Xia frontline and seized Wang Wan, capturing him back along with his horse. Later, in the main engagement, Li Shimin defeated and captured Dou, and Wang Shichong, distressed, surrendered. Zheng and Xia territory were seized by Tang.

By fall 621, however, Dou's general Liu Heita had risen against Tang rule and regained most of former Xia territory. At that point, Yuchi was not under Li Shimin's command, as he was fighting invading Eastern Tujue forces at Yuan Prefecture (, roughly modern Guyuan, Ningxia). In 622, when Li Shimin went to fight Liu Heita, however, Yuchi was again under his command, and once, when Li Shimin tried to aid another Tang general, Li Shiji, Liu had him surrounded. Li Shimin was saved only after Yuchi fought his way in to rescue him. Li Shimin was later able to defeat Liu Heita, forcing him to flee to Eastern Tujue. (Later that year, however, Liu Heita would return and again take over former Xia territory, only to be later defeated by Li Shimin's older brother Li Jiancheng the Crown Prince.) Yuchi also then followed Li Shimin in his campaign against Liu Heita's ally Xu Yuanlang. In 623, he was again fighting invading Tujue forces, this time at Shuo Prefecture, and then in 624 at Long Prefecture (, modern western Baoji, Shaanxi).

Involvement at the Incident at Xuanwu Gate

By this point, Li Shimin was locked in an intense rivalry with Li Jiancheng, who was supported by Li Yuanji. Li Jiancheng and Li Yuanji, because they saw that Li Shimin had many fierce officers under him, wanted to try to tempt them to leave Li Shimin and follow Li Jiancheng. Li Jiancheng sent large sums of gold and silver to Yuchi to try to persuade him to join Li Jiancheng. Yuchi wrote back, declining the gift, and pointed out that he needed to be faithful to Li Shimin. Li Jiancheng, in anger, cut off his relations with Yuchi, and soon sent assassins against Yuchi. Yuchi took precautions, however, and the assassination was not successful. Li Yuanji then falsely accused Yuchi of crimes, and Emperor Gaozu arrested Yuchi and wanted to execute him; Yuchi was only saved after intercession by Li Shimin.

In summer 626, Li Shimin, fearing that Li Jiancheng would kill him, was considering acting against Li Jiancheng and Li Yuanji preemptively but was hesitating. Yuchi, in particular, was a major advocate for preemptive action, and when rumor was reported to Li Shimin that Li Yuanji was planning to first kill Yuchi, Cheng Zhijie, Qin Shubao and Duan Zhixuan (), Yuchi stated:

All humans fear death. However, we are now willing to support Your Royal Highness with our lives, and this is the will of Heaven. Great disaster is about to come, and Your Royal Highness believes that there is nothing to worry. Even if you do not think of yourself, what about the future of the empire and the imperial temples? If Your Royal Highness does not accept my suggestion, I will flee your mansion and roam the wilderness. I cannot remain here, waiting to have my hands be bound and to be executed!

With particular advocacy from Yuchi and Zhangsun Wuji, Li Shimin decided to take action. Li Shimin tried to summon his strategists Fang Xuanling and Du Ruhui, who had been demoted out of his mansion based on accusations by Li Jiancheng and Li Yuanji, and when Fang and Du initially resisted (as they feared Emperor Gaozu's wrath), Li Shimin sent Yuchi to summon them, with the direction that if they refused, that they be killed. Yuchi was able to persuade Fang and Du that Li Shimin was about to take action and that they should not fear, and then divided up with Fang and Du, arriving at Li Shimin's mansion separately.

Meanwhile, Li Shimin submitted a secret accusation to Emperor Gaozu that Li Jiancheng and Li Yuanji were committing adultery with Emperor Gaozu's concubines and were planning to kill Li Shimin, and then laid an ambush for Li Jiancheng and Li Yuanji at Xuanwu Gate, at the entrance of Emperor Gaozu's palace. As Li Jiancheng and Li Yuanji were approaching Emperor Gaozu's palace, ready to answer the charges against them, they sensed that something was unusual, and tried to turn back. By this point, though, Li Shimin had them in a trap, and he killed Li Jiancheng with an arrow. Subsequently, Yuchi arrived with 70 men, and they killed Li Yuanji's horse, causing Li Yuanji to fall off his horse. Meanwhile, however, Li Shimin's horse was spooked and ran into a forest. Li Shimin fell off his horse, and Li Yuanji tried to kill him by strangling him with a bow. Yuchi then arrived, and Li Yuanji fled, trying to get back to his own palace Wude Palace (武德殿). Yuchi chased him and killed him with an arrow.

Subsequently, Li Shimin ordered Yuchi to lead his men into Emperor Gaozu's palace, ostensibly to protect Emperor Gaozu. Yuchi entered in full armor and wielding his lance—considered usually to be a highly improper action—into Emperor Gaozu's presence, as Emperor Gaozu was attended by the high level officials Pei Ji, Xiao Yu, and Chen Shuda. Emperor Gaozu was shocked and asked, "Who is committing treason? What are you doing here?" Yuchi stated to Emperor Gaozu:

The Crown Prince and Prince of Qi have committed treason. The Prince of Qin mobilized his troops and executed them. As he feared that Your Imperial Majesty would be shocked, he sent me here to protect you.