Liu Wenjing

[1]), courtesy name Zhaoren (肇仁), formally the Duke of Lu (魯公), was a Chinese politician during the Tang dynasty.

According to Liu Wenjing himself, his ancestors were from Pengcheng (彭城, in modern Xuzhou, Jiangsu), but later moved to the Chang'an region.

His father Liu Shao (劉韶) served in the army of the succeeding Sui dynasty and died in battle.

As a result of this and the posthumous honors that Liu Shao received, Liu Wenjing received a governmental rank, and late in the reign of Emperor Yang, he was the county magistrate at the important city of Jinyang (晉陽, in modern Taiyuan, Shanxi), where he became friendly with another official, Pei Ji, who was the head of the household at Emperor Yang's secondary palace at Jinyang.

As Li Yuan prepared rebellion in spring 617, his deputies Wang Wei (王威) and Gao Junya (高君雅) began to be suspicious of him.

Li Yuan agreed, and sent Liu to Eastern Tujue to meet with the Shibi Khan Ashina Duojishi.

Subsequently, after Li Yuan decided to bypass Hedong (河東, in modern Yuncheng, Shanxi) and directly cross the Yellow River and attack Chang'an, he sent Liu with his son Li Jiancheng to Tong Pass to defend against an attack from Qutu Tong (屈突通), the Sui general defending Hedong.

In spring 618, Emperor Yang was killed in a coup at Jiangdu (江都, in modern Yangzhou, Jiangsu) led by the general Yuwen Huaji.

When the news arrived at Chang'an, Li Yuan had Yang You yield the throne to him, establishing Tang dynasty as its Emperor Gaozu.

He made Liu Wenjing Nayan (納言), the head of the examination bureau of the government, considered one of the posts for a chancellor.