 What is known is that he was an army officer from Taining Circuit (泰寧, headquartered in modern Jining, Shandong) who participated in the operations against the major agrarian rebel Huang Chao early in the reign of Emperor Xizong.In 879, the imperial government commissioned him to replace Cao Quanzhen () as the commander of the operations against Huang west of the Yangtze River — while Cao was pursuing Huang in the aftermaths of a major defeat Cao and Liu Jurong () the military governor ("Jiedushi") of Shannan East Circuit (山南東道, headquartered in modern Xiangfan, Hubei) had just dealt Huang — which led to Cao's termination of the pursuit, allowing Huang and Huang's major general Shang Rang to escape.Meanwhile, with Liu Jurong having returned to Shannan East after defeating Huang, and with the overall commander of the operations, the former chancellor Wang Duo, who was also the military governor of Jingnan, having fled prior to Cao's and Liu's defeat of Huang Chao, there was no military governor around to govern Jingnan Circuit.