In 798, Yu Di was made the military governor of Shannan East Circuit (, headquartered in modern Xiangfan, Hubei) and the prefect of its capital Xiang Prefecture (). Shortly thereafter, Wu Shaocheng the military governor of Zhangyi Circuit (, headquartered in modern Zhumadian, Henan), whose circuit bordered Yu's, rebelled against Emperor Dezong's authority, and Yu was one of the generals commissioned to attack Wu. In 799, Yu captured two counties from Wu — Wufang () and Langshan () (both in modern Zhumadian).