Pei Du (; 765 – April 21, 839), courtesy name Zhongli (), posthumous name Duke Wenzhong of Jin (), was a Chinese politician and government official of the Tang dynasty, serving as a chancellor during the reigns of Emperor Xianzong, Emperor Muzong, Emperor Jingzong and Emperor Wenzong. Although Pei was a civilian official, he was also known for his military strategies, and he is best known for being in charge of the campaign against the warlord Wu Yuanji during Emperor Xianzong's reign.

Background Pei Du was born in 765, during the reign of Emperor Daizong. His family was from Hedong (河東, in modern Yuncheng, Shanxi)Old Book of Tang, vol. 170. and traced his ancestry back to a line of government officials dating back to the Han Dynasty, Jin Dynasty (266–420), Former Yan, Later Qin, and Northern Wei, although Pei Du's direct ancestors was not listed with governmental offices for several generations until his grandfather Pei Youlin (), who served as a county magistrate, and his father Pei Xu () served as a county secretary general.New Book of Tang, vol. 71.

In 789, during the reign of Emperor Daizong's son Emperor Dezong, Pei Du passed the imperial examinations and the special examination for grand speech. He later further passed special examinations for those who could properly criticize the government. He was thereafter made the sheriff of Heyin County (河陰, in modern Luoyang, Henan), and thereafter was made an imperial censor with the title Jiancha Yushi (). At one point, he submitted a secret petition that criticized those who were powerful due to their associations with Emperor Dezong, and thus was sent out of the capital Chang'an to serve as an administrator at the Henan Municipality (河南, i.e., the Luoyang region) government. He later became an imperial archiver (起居舍人, Qiju Sheren).

During Emperor Xianzong's reign In 811, during the reign of Emperor Dezong's grandson Emperor Xianzong, Pei Du was made Sifeng Yuanwailang (), a low-level official at the ministry of civil service affairs (吏部, Libu), and put in charge of drafting edicts. He was soon promoted to be Sifeng Langzhong (), a supervisorial official at the ministry of civil service affairs.

In 812, after Tian Xing the military governor (Jiedushi) of Weibo Circuit (魏博, headquartered in modern Handan, Hebei) submitted his circuit to imperial orders (previously, under Tian Xing's predecessor Tian Ji'an and prior military governors, Weibo had been governed in a de facto independent manner from the imperial government), Emperor Xianzong sent Pei to Weibo to comfort Tian Xing and the soldiers and to give a large cash reward to the Weibo soldiers. It was said that while at Weibo, Pei often spoke of the ways of faithfulness to Tian Xing, and that Tian Xing was attentive to Pei's encouragement.Zizhi Tongjian, vol. 239. After Pei returned from the mission to Weibo, he was made Zhongshu Sheren (), a mid-level official at the legislative bureau of government (中書省, Zhongshu Sheng).

In 814, Pei was made deputy chief imperial censor (御史中丞, Yushi Zhongcheng). While serving in that office, there was an occasion in spring 815 when he interceded on behalf of the exiled official Liu Yuxi, who was set to be made the prefect of Bo Prefecture (播州, in modern Zunyi, Guizhou), pointing out that, as Liu Yuxi's friend Liu Zongyuan, who was also to be exiled and who had offered to go to Bo Prefecture in Liu Yuxi's stead, that Bo Prefecture was so remote that Liu Yuxi could not possibly take his mother with him, and further pointing out that Emperor Xianzong himself also still had to support his mother (Empress Dowager Wang). Emperor Xianzong thus made Liu Yuxi the prefect of the somewhat less remote Lian Prefecture (連州, in modern Qingyuan, Guangdong).

By that point, Emperor Xianzong was deeply involved in a campaign against the warlord Wu Yuanji, who controlled Zhangyi Circuit (彰義, headquartered in modern Zhumadian, Henan). He sent Pei to the front to observe the campaign. Upon return, Pei reported his belief that Wu could be defeated, and further commended the general Li Guangyan for his bravery and righteousness. When Li Guangyan subsequently often had victories against Zhangyi troops, Emperor Xianzong came to believe Pei to have good judgment of character.

In winter 815, assassins killed the chancellor Wu Yuanheng, who had been in charge of the campaign against Wu Yuanji; on the same morning, assassins tried to kill Pei as well, injuring Pei's head and causing Pei to fall into a ditch, but Pei's head was protected by a thick hat, allowing him to survive the attack. There was suggestions by some officials that Pei should be removed from office to appease Wu Yuanji's allies Wang Chengzong the military governor of Chengde Circuit (成德, headquartered in modern Shijiazhuang, Hebei) and Li Shidao the military governor of Pinglu Circuit (平盧, headquartered in modern Tai'an, Shandong). Emperor Xianzong rejected such talk, stating, "If I remove Pei Du from office, it will fulfill the desires of the treacherous, and the imperial government will no longer have any authority. My having Pei Du is sufficient to destroy the two bandits." He made Pei Zhongshu Shilang (), the deputy head of the legislative bureau, as well as de facto chancellor with the title Tong Zhongshu Menxia Pingzhangshi (). Subsequently, when Pei pointed out that then-overall commander of the campaign against Wu Yuanji, Yan Shou (), was incompetent, Emperor Xianzong made Han Hong the military governor of Xuanwu Circuit (宣武, headquartered in modern Kaifeng, Henan) overall commander instead.

Pei continued to be a steadfast advocate for continuing the campaign against Wu Yuanji. In summer 816, after the imperial general Gao Xiayu () suffered a major defeat against Zhangyi troops, there were renewed talks among officials that the campaign should end. Emperor Xianzong was said to continue to follow Pei's advice, and Emperor Xianzong spoke sternly against those who suggested ending the campaign.

In winter 816, after the official Wang E () died and offered much of his wealth to the imperial government, two servants of Wang's made a report that Wang Ji () had secretly modified Wang's will and hid some of the assets. Emperor Xianzong was set to send eunuchs to investigate this report, but Pei pointed out that Wang E had already offered a large amount of wealth, and investigations would cause all other officials to worry about what would happen after they died. Emperor Xianzong agreed, ended the investigation, and had Wang's servants executed.

As of fall 817, the campaign against Zhangyi was still ongoing without ultimate success. Pei's colleague Li Fengji advocated ending the campaign on account of army fatigue and treasury depletion. Pei, instead, offered to personally head to the front to oversee the campaign. Emperor Xianzong agreed, and, while Han remained titular overall commander, Pei was effectively put in charge and given a staff of talented officials and military officers, and he was also made the military governor of Zhangyi in anticipation of victory. When he wanted to take the general Zhang Maohe (張茂和, a son of the general Zhang Xiaozhong) as a subordinate, Zhang was fearful and declined. Pei requested that Zhang be executed for refusing a direct order, but Emperor Xianzong spared Zhang and only exiled him. Also, as Pei was concerned that the imperial scholar Linghu Chu would cooperate with Li Fengji in opposing the campaign after he left Chang'an, he accused Linghu of using inappropriate language on Pei's commissioning edict and had Linghu demoted. Before Pei departed, he stated to Emperor Xianzong:Zizhi Tongjian, vol. 240.

Emperor Xianzong was greatly touched and shed tears.

Once Pei reached the front, he saw that the generals were hesitant to make their own decisions because they were being monitored by eunuchs sent by Emperor Xianzong. At Pei's request, the eunuch monitors were recalled, and it was said that only thereafter did the generals dare to make their own decisions. While Pei was at the front, there was an occasion when a surprise attack by the Zhangyi general Dong Chongzhi () nearly killed him, but he was protected by Li Guangyan and Tian Bu (Tian Xing's son) and escaped the attack.

Meanwhile, one of the imperial generals, Li Su the military governor of Tangsuideng Circuit (唐隨鄧, headquartered in modern Zhumadian) was planning a surprise attack on Zhangyi's capital Cai Prefecture (). When Li Su reported this plan to Pei, Pei approved of it. In winter 817, Li Su launched his attack and captured Cai Prefecture, taking Wu Yuanji captive and delivering him to Chang'an. When Pei subsequently arrived at Cai Prefecture, Li Su waited by the road to be ready to pay proper respect to Pei by military ceremony. Pei initially, in humility, wanted to avoid having Li Su bow to him, but Li Su pointed out that it was proper for them to demonstrate the proper etiquette for the imperial army before the surrendered soldiers and people of Cai Prefecture. Pei thus agreed.

During the brief time that Pei was at Cai Prefecture, he used the Cai Prefecture soldiers as his own guards. When there was warning by his subordinates that there were still many rebellious individuals in the Cai Prefecture army, Pei laughed and responded:

It was said that Pei's attitude touched the people of Cai Prefecture. Further, as during the rule of Wu Yuanji and his father Wu Shaoyang the people of Cai Prefecture were under strict regulations not to congregate, not to light candles at night, and not to hold feasts, Pei repealed all of these regulations. It was said that only then was some measure of normal life restored to the people of Cai Prefecture.

Around the new year 818, Emperor Xianzong was then set to recall Pei. Pei made his officer Ma Zong () the acting military governor and departed Cai Prefecture. On the way, he encountered the imperial eunuch Liang Shouqian (), who had been bestowed two swords and given order to execute Wu Yuanji's former officers. Pei accompanied Liang back to Cai Prefecture and, not following Emperor Xianzong's orders in entirety, carried out punishment according to the faults of the officers rather than executing them. Only after doing so did he again depart Cai Prefecture. Emperor Xianzong thereafter created Pei the Duke of Jin and recalled him to Chang'an to again be chancellor.

While Pei was still at Zhangyi, his subordinate Han Yu recommended the commoner Bo Qi () for a mission to persuade Wang Chengzong (whom Emperor Xianzong had believed to have been behind Wu Yuanheng's assassination and therefore declared a campaign against as well) to submit to imperial orders. Pei agreed and sent Bo. Wang, who was fearful after Wu Yuanji's destruction, sent his sons as hostages and surrendered two of his six prefectures to imperial control, offering to submit to imperial orders. Emperor Xianzong, after Tian Xing (whose name had been changed to Tian Hongzheng by this point) spoke in favor, agreed.