Du Yuanying (杜元穎; 769–833), formally the Baron of Jian'an (建安男), was an official of the Chinese dynasty, serving as a chancellor during the reign of Emperor Muzong. His policy error while being chancellor was blamed for the imperial government's losing control over the circuits north of the Yellow River. While later serving as the military governor (Jiedushi) of Xichuan Circuit (西川, headquartered in modern Chengdu), he was further blamed for failure of discipline that caused his soldiers to provoke a major Nanzhao invasion against Xichuan, leading to his exile. Background Du Yuanying was born in 769, during the reign of Emperor Daizong. Traditional histories indicate that he was from the same clan as the famous early-Tang Dynasty chancellor Du Ruhui, but provide conflicting accounts as to whether he was descended from Du Ruhui – with Du Yuanying's biography in the Old Book of Tang indicating that he was a "descendant" of Du Ruhui's; his biography in the New Book of Tang indicating that he was a fifth-generation descendant of Du Ruhui's; the table of the chancellors' family trees in the New Book of Tang indicating that he was a descendant of Du Ruhui's uncle Du Yan, who was himself a chancellor as well; and the Zizhi Tongjian, apparently adopting that latter assertion, indicating that he was a descendant of Du Yan's. In any case, the Du clan claimed original ancestry from the Zhou Dynasty states Tang and Du and traced its ancestry to officials of Lu, Chu, Qin Dynasty, Han Dynasty, Cao Wei, Jin Dynasty (266–420), Sui Dynasty, and Tang. Neither Du Yuanying's great-grandfather Du Ziyuan (杜自遠) nor grandfather Du Fan (杜繁) was listed with any offices, although Du Yuanying's father Du Zuo (杜佐) served as a judge at the supreme court. Du Yuanying had at least one younger brother, Du Yuanjiang (杜元絳). Du Yuanying himself passed the imperial examinations late in the Zhenyuan era (785–805) of Emperor Daizong's son Emperor Dezong, and thereafter served on the staff of a regional governor. During Emperor Xianzong's reign During the middle of the Yuanhe era (805–821) of Emperor Dezong's grandson Emperor Xianzong, Du Yuanying became a Zuo Shiyi (左拾遺), a low-level consultant at the examination bureau of government (門下省, Menxia Sheng); and then a You Bujue (右補闕), a higher-ranked consultant at the legislative bureau (中書省, Zhongshu Sheng). He was then also made an imperial scholar (翰林學士, Hanlin Xueshi). Du wrote things quickly