Pei Du
The imperial forces sent against Zhangyi and Chengde were unsuccessful in quickly achieving final victory against them, however. In 817, with suggestion from the chancellor Li Fengji that he should concentrate on one campaign, Emperor Xianzong called off the campaign against Chengde (although he did not pardon Wang). Meanwhile, Pei Du volunteered to head to the Zhangyi front to oversee the operation, and Emperor Xianzong agreed. Later in the year, Li Su the military governor of Tangsuideng Circuit (唐隨鄧, headquartered in modern Zhumadian) launched a surprise attack against Zhangyi's capital Cai Prefecture (), catching its defenders off guard and capturing it, seizing Wu Yuanji. Wu was subsequently delivered to Chang'an to be executed, and the imperial troops under Pei took over Zhangyi.