 In 446, when Northern Wei was facing a rebellion from the ethnically-Xiongnu Gai Wu (), Emperor Wen commissioned Gai as a duke and a general, although he provided no actual military support for Gai.This, however, aggravated Northern Wei's Emperor Taiwu, and after Emperor Taiwu put down Gai's rebellion, the relationship between the two states turned sour, particularly in light of a horrific raid that Northern Wei troops carried out against Liu Song's Qing (青州, modern central and eastern Shandong), Ji (冀州, modern northwestern Shandong), and Yan (兗州, modern western Shandong) Provinces later that year.By 449, Emperor Wen was preparing a second campaign to recover the provinces south of the Yellow River, and many generals and officials, in response, submitted battle plans, and the general Wang Xuanmo () submitted plans that Emperor Wen particularly liked.