 Yang sent the general Wei Xiaokuan against Yuchi, and Yuwen served under Wei.He defeated Yuchi's general Li Jun (李雋), and later, with other generals, defeated Yuchi's son Yuchi Dun (尉遲惇).Eventually, after Wei was victorious over Yuchi Jiong, forcing Yuchi Jiong to commit suicide, Yuwen's title was promoted to Duke of Bao.