In 618, after news arrived at Chang'an that Emperor Yang was killed in a coup at Jiangdu led by the general
Yuwen Huaji, Li Yuan had Yang You yield the throne to him, establishing
Tang dynasty as its Emperor Gaozu. Li Jing continued serving the new dynasty. In 619, Li Jing participated in a campaign against one of Tang's major enemies,
Wang Shichong the Emperor of Zheng, and was promoted for his accomplishments. Later that year, Emperor Gaozu sent him to
Kui Prefecture (, modern eastern
Chongqing) to plan a military operation against another major enemy,
Xiao Xian the Emperor of Liang, who then ruled the modern
Hubei,
Hunan, and
Guangxi region. When he first reached Jin Prefecture (, roughly modern
Ankang,
Shaanxi), he encountered bandits in the mountain, who had several times defeated Li Yuàn (, note different tone and character than Emperor Gaozu's name ()) the Prince of Lujiang (Emperor Gaozu's distant nephew). Li Jing joined forces with Li Yuàn to defeat those bandits. However, as he arrived at the borders with Liang, he was blocked by Liang forces and long could not reach there, having to stop at Xia Prefecture (, roughly modern
Yichang,
Hubei). Emperor Gaozu, believing that Li Jing was intentionally not advancing, was sufficiently angry that he secretly ordered the commandant at Xia Prefecture, Xu Shao (), to execute Li Jing. Xu, however, was appreciative of Li Jing's talent, and submitted a petition urging that Li Jing be spared, and Emperor Gaozu relented. Meanwhile, in spring 620, around the same time, Ran Zhaoze () the leader of the Kaishan Tribe (), rebelled against Tang rule and attacked Kui Prefecture. When Emperor Gaozu's distant nephew
Li Xiaogong the Duke of Zhao Commandery fought Ran, he was initially unsuccessful, but Li Jing reinforced him with 800 men and defeated and killed Ran. In 621, Li Jing submitted 10 strategies against Liang, and Li Xiaogong submitted them to Emperor Gaozu. Emperor Gaozu approved of Li Jing's plans, and made Li Jing Li Xiaogong's assistant in the campaign against Liang. It was said that as Li Xiaogong was still inexperienced, Emperor Gaozu actually put Li Jing in charge of most of the operations, although Li Xiaogong was formally commander of the operations. In fall 621, Emperor Gaozu commissioned Li Xiaogong, with Li Jing as his assistant, to launch a major attack on Xiao Xian's Liang state, with Li Yuàn and the other generals Tian Shikang () and Zhou Faming () attacking on other fronts. At that time, the
Yangtze River had a high water level and was flowing rapidly. While many officers under him suggested delaying the campaign, Li Jing suggested to Li Xiaogong that the rapid water was a good opportunity to launch a surprise attack on Xiao Xian's capital Jiangling (, in modern
Jingzhou,
Hubei). After defeating the Liang general Wen Shihong (), Li Xiaogong put Jiangling under siege, cutting off Xiao Xian's communications with the armies in the rest of his territory. Li Jing suggested floating the Liang ships that they captured down the Yangtze, to confuse the approaching Liang relief forces into believing that Jiangling had fallen already. Xiao, not knowing that the relief forces were only a few days away, surrendered to Li Xiaogong. By the suggestion of Li Jing and Xiao's official
Cen Wenben, who had persuaded Xiao to surrender, Li Xiaogong strictly prohibited pillaging and retribution against Liang generals. The Liang provinces, upon hearing the news of Jiangling's fall, soon largely submitted to Tang. Li Xiaogong delivered Xiao to Chang'an, where Emperor Gaozu executed him. For his accomplishments, Li Jing was created the Duke of Yongkang. Subsequently, Emperor Gaozu commissioned Li Jing to head south to persuade the modern
Guangdong and
Guangxi region, which had submitted to Xiao Xian and another rebel ruler,
Lin Shihong the Emperor of Chu, to submit to Tang. Li Jing advanced to Gui Prefecture (, roughly modern
Guilin,
Guangxi) and was able to persuade several of the most major warlords of the region, including Feng Ang (), Li Guangdu (), and Ning Zhenzhang () to submit to Tang. Subsequently, Li Jing was made the commandant at Gui Prefecture. In fall 623, the Tang general
Fu Gongshi, who had served as the deputy of the powerful general
Li Fuwei the Prince of Wu as the military governor of the lower Yangtze region, rebelled against Tang rule while Li Fuwei was at Chang'an, declaring himself the Emperor of Song. Emperor Gaozu commissioned Li Xiaogong to attack Fu, again making Li Jing Li Xiaogong's assistant, and also sending other generals Huang Junhan () and
Li Shiji to attack Fu from other fronts. Li Xiaogong and Li Jing sailed down the Yangtze, attacking and defeating the Song generals at multiple battles. Fu ordered his generals Feng Huiliang () and Chen Dangshi () to take up position at Mount Bowang (, in modern
Ma'anshan,
Anhui, preparing for the assault, instructing Feng and Chen not to engage Li Xiaogong, but to wear him down. However, Li Xiaogong, under Li Jing's suggestion, cut off their supply route, and when Feng and Chen's food supplies ran low, they challenged Li Xiaogong. Against suggestions by some officers that he bypass Feng and Chen and attack the Song capital Danyang (, in modern
Nanjing,
Jiangsu) directly, Li Xiaogong, again with Li Jing's suggestion, confronted Feng and Chen, initially using the weaker segment of his forces to battle Feng and Chen and, after initial losses, draw Feng and Chen in deeper, and then attacked them, defeating them decisively, with the aid of Li Fuwei's subordinate general Kan Leng (). After the victory, Li Xiaogong and Li Jing attacked Danyang. Fu, in fear, abandoned Danyang and fled east, but was captured by the local men and delivered to Danyang. Emperor Gaozu, praising Li Jing, made the comment: "Li Jing is the fatal illness for Xiao and Fu. How could even
Han Xin,
Bai Qi,
Wei Qing, or
Huo Qubing exceed him?" Subsequently, Li Xiaogong was put in charge of the region, and Li Jing served as his assistant. it was said that Li Jing contributed much in pacifying the region after the region had seen much bloodshed for years. In 625, Eastern Tujue attacked Taiyuan, and Li Jing led some of his troops north to resist Eastern Tujue. It was said that all of the other Tang generals were defeated by Eastern Tujue forces, but Li Jing was able to preserve his troops. In 626, when Eastern Tujue attacked again, Li Jing was made the commandant at Ling Prefecture (, roughly modern
Yinchuan,
Ningxia), and he tried to cut off Eastern Tujue's return path, although soon Tang and Eastern Tujue made peace. It was said that at this time that Li Shimin, then engaged in an intense rivalry with his older brother
Li Jiancheng the
Crown Prince and fearing that Li Jiancheng might be intending to kill him, solicited advice from Li Jing and Li Shiji, and both refused to speak on the matter, drawing respect from Li Shimin for their unwillingness to be involved in an internecine struggle. In 626, Li Shimin set a show down for Li Jiancheng and another brother,
Li Yuanji the Prince of Qi at
Xuanwu Gate, killing them, and then effectively forced Emperor Gaozu to create him crown prince and then pass the throne to him (as Emperor Taizong). == During Emperor Taizong's reign ==