Wang Wujun (; 735 – August 9, 801), courtesy name Yuanying (), né Monuogan (), posthumous name Prince Zhonglie of Langye (), was an ethnic Khitan military general and politician of China's Tang dynasty. He served as a long-time jiedushi of Chengde Circuit (成德; headquartered in modern-day Shijiazhuang, Hebei) during the reign of Emperor Dezong and ruling Chengde in a de facto independent manner from the Tang imperial court.

Background Wang Wujun was born in 735 and originally known as Muonuogan. He was from Nujie () tribe, of Khitan stock. His grandfather was named Kenagan (), and his father was named Luju (). During Emperor Xuanzong of Tang's Kaiyuan era (713-741), Luju followed his leader Li Shi (), who took 5,000 households in crossing into Tang borders to submit to Tang. Emperor Xuanzong praised them and allowed them to live in Ji Prefecture (薊州, in modern Tianjin).Old Book of Tang, vol. 142 .According to the Zizhi Tongjian, a Xi leader named Li Shi submitted to Tang in 732, but it is not clear whether that Li Shi was the same Li Shi whom Luju followed. See Zizhi Tongjian, vol. 213.

It is not known when Wang Wujun acquired the name of Wujun, but it is known that by age 14, he was known for his horsemanship and archery, and he became as famous as Zhang Alao (later known as Zhang Xiaozhong) in the region. Both of them later served the army officer Zhang Zhongzhi, who in turn served under the general An Lushan, who then controlled the region.New Book of Tang, vol. 211 .

Service under Li Baochen (Zhang Zhongzhi) In 755, An Lushan rebelled against Emperor Xuanzong, and soon declared himself the emperor of a new state of Yan.Zizhi Tongjian, vol. 217. Zhang Zhongzhi served as a major general of the Yan state, but by 762, Yan, then with Shi Chaoyi as its emperor, was nearing final defeat, and Tang forces were entering the heart of its territory north of the Yellow River. Zhang was then defending Heng Prefecture (恆州, in modern Shijiazhuang, Hebei), and Wang Wujun persuaded him to submit to Tang. Zhang agreed and submitted to Tang with the five prefectures that he controlled, and turned against remaining Yan forces. Emperor Xuanzong's grandson Emperor Daizong, then emperor of Tang, bestowed the imperial surname of Li on Zhang, and Zhang thereafter became known as Li Baochen. Li Baochen was allowed to retain control over the territory he had, which was organized into Chengde Circuit, with Li Baochen as its military governor (Jiedushi). As Wang contributed in the subsequent campaign that cleared the territory, he was created the Prince of Weichuan.

As Li Baochen grew old and intended to pass the territory to his son Li Weiyue, he began killing a number of officers that he feared Li Weiyue could not control. However, as he took a great liking to Wang's son Wang Shizhen and gave Wang Shizhen his daughter in marriage, and Wang Shizhen subsequently gained Li Baochen's trust as well as insider information at LI Baochen's headquarters, Wang Wujun escaped the fate of many of his colleagues.

Service under Li Weiyue Meanwhile, Li Baochen had also been in alliance with several other military governors who were also ruling their circuits independently from the imperial regime and intending to pass their realms to their descendants — Li Zhengji the military governor of Pinglu Circuit (平盧, headquartered in modern Tai'an, Shandong), Tian Chengsi the military governor of Weibo Circuit (魏博, headquartered in modern Handan, Hebei), and Liang Chongyi the military governor of Shannan East Circuit (山南東道, headquartered in modern Xiangfan, Hubei). When Li Baochen and Li Zhengji, in succession, died in 781, then-emperor Emperor Dezong (Emperor Daizong's son), wanting to break up the warlords' power, refused to let Li Weiyue and Li Zhengji's son Li Na inherit their fathers' positions. Li Weiyue, Li Na, Tian Chengsi's nephew and successor Tian Yue, and Liang thus prepared for war against the imperial regime.Zizhi Tongjian, vol. 226. Liang was quickly defeated by Li Xilie and committed suicide, while imperial forces inflicted serious damage on Tian's and Li Na's forces. Meanwhile, Zhu Tao the acting military governor of Lulong Circuit (盧龍, headquartered in modern Beijing) attacked Li Weiyue from the north and was quickly able to persuade two key Chengde officers, Zhang Xiaozhong the prefect of Yi Prefecture (易州, in modern Shijiazhuang) and Kang Rizhi () the prefect of Zhao Prefecture (趙州, in modern Shijiazhuang), to submit their respective prefectures turn against Li Weiyue. When Li Weiyue tried to counterattack in spring 782, Zhu and Zhang's joint forces defeated him at Shulu (束鹿, in modern Shijiazhuang), forcing him to flee back to Chengde's capital Heng Prefecture. It was said that during the Battle of Shulu, Wang Wujun, serving as Li Weiyue's forward commander and believing that Li Weiyue was already suspicious of him, decided not to fight to the best of his ability, and that this led to the defeat.Zizhi Tongjian, vol. 227.

After the defeat, Li Weiyue was even more suspicious of Wang, but his advisors pointed out that there was no one other than Wang who would be capable to command the army. Li Weiyue thus commissioned Wang, assisted by Wei Changning (), to attack Zhao Prefecture, and put Wang Shizhen in charge of security at headquarters. Wang Wujun was relieved to get to leave Heng Prefecture, and once he exited the city, initially wanted to flee to Zhang. Wei pointed out that Emperor Dezong had issued an edict promising to give the offices that Li Weiyue wanted to whoever would cut off Li Weiyue's head and advocated for an attack on Li Weiyue. Wang Wujun thus notified Wang Shizhen and involved Li Weiyue's close associate Xie Zun () in the plot at well. He made a surprise attack against Heng Prefecture, and Wang Shizhen and Xie opened the city gates to welcome him. Wang Wujun killed Li Weiyue and his associates and surrendered to the imperial government.

Rebellion against Emperor Dezong Emperor Dezong, in the aftermaths, divided Chengde's seven prefectures into three smaller circuits — with Zhang Xiaozhong receiving three prefectures and the title of military governor of the newly created Yidingcang Circuit (易定滄, headquartered in modern Baoding, Hebei, later renamed Yiwu Circuit (), while Wang Wujun and Kang Rizhi received two prefectures each with lesser titles of military prefect (團練使, Tuanlianshi), of Hengji () and Shenzhao (深趙, both headquartered in modern Shijiazhuang). This displeased both Zhu Tao and Wang — as Zhu had wanted Emperor Dezong to give him Shen Prefecture (深州, in modern Hengshui, Hebei), which went to Kang instead (Emperor Dezong gave Zhu two prefectures on paper, De (德州, in modern Dezhou, Shandong) and Di (棣州, in modern Binzhou, Shandong), both then still held by Li Na, and Wang believed that Emperor Dezong had reneged on the promise to reward him with the positions that Li Weiyue had wanted. He was further fearful when he received orders to provide Zhu's army with food and Ma Sui's army (which was then attacking Tian Yue) with horses, believing that Emperor Dezong might be using those orders to divert his power and getting ready to attack him next.

Tian, hearing of Zhu's disaffection, sent emissaries to Zhu to persuade him to turn against the imperial forces and aid him. Zhu agreed, and in turn sent emissaries to Wang, persuading him to join the alliance as well and agreeing to give him Shen Prefecture, which Zhu occupied at the time. Wang was pleased, and agreed to join him and Tian. (Zhu also tried to persuade Zhang to join the alliance, but Zhang refused.) When Emperor Dezong sent emissaries to order Zhu and Wang to advance south against Tian, Wang arrested the imperial emissaries and delivered them to Zhu, thus openly turning against imperial authority. Zhu, as promised, transferred control of Shen Prefecture to Wang, while sending forces to join Wang's in sieging Kang at Zhao Prefecture.

However, by this point, Tian was in desperate straits under siege from imperial forces commanded by Ma, Li Baozhen, and Li Qiu () at his capital Wei Prefecture (). Zhu and Wang thus advanced south to relieve him, and as they arrived, so did additional imperial forces commanded by Li Huaiguang. Against Ma's advice of waiting until his soldiers had enough rest, Li Huaiguang decided to battle Zhu and Wang immediately. He had initial successes, but Wang cut his soldiers off from each other with a charge, leading to a major defeat for the imperial forces. Zhu and Wang then tried to cut off the imperial troops escape, but Ma then promised to request that Emperor Dezong put Zhu in charge of the entire region north of the Yellow River. Despite Wang's stern opposition, Zhu believed him and did not pursue imperial forces further, so the imperial forces were able to withdraw over a river from Wei Prefecture, and were able to take up a posture against the rebel forces, thus putting the armies into a stalemate. Zhu, seeing that he had been tricked by Ma, apologized to Wang, but Wang, while accepting the apology, thereafter resented Zhu.

In the aftermaths of the imperial forces' defeat, Tian was grateful to Zhu, and offered to subjugate himself and Wang to Zhu — in effect, offering the emperor title to Zhu. Zhu declined, crediting Wang rather than himself for the victory. At the suggestion of Zhu's staff member Li Ziqian () and Wang's staff member Zheng Ru (), they decided to each claim a princely title to show independence from imperial authority, but keep Tang's era name in order not to completely break from Tang. On December 9, 782, in an elaborate ceremony, Zhu claimed the title of Prince of Ji; Wang claimed the title of Prince of Zhao; Tian claimed the title of Prince of Wei; and they issued a letter offering Li Na the title of Prince of Qi. They also established administrations with governmental structures paralleling the Tang imperial government to further show independence, although the titles were intentionally different from Tang's to show some subordination.

As self-proclaimed Prince of Zhao Meanwhile, though, as Zhu Tao's and Wang Wujun's troops were continuing to battle Tang imperial troops on Tian Yue's soil, all three of them were becoming financially drained. They pinned their hopes on alliance with Li Xilie, who had even greater pretensions, who was then ruling Huaixi Circuit (淮西, headquartered in modern Xuchang, Henan), which was then wealthy. They, along with Li Na, thus sent emissaries to Huaixi, suggesting to Li Xilie that he take imperial title. Li Xilie did not do so immediately, but began to claim titles greater than the ones bestowed him by Emperor Dezong.Zizhi Tongjian, vol. 228. (Li Xilie would eventually declare himself to be the emperor of a new state of Chu in spring 784, although without further pledge of allegiance by the four.)Zizhi Tongjian, vol. 229.