In winter 391, Liu Wenchen sent his son Liu Zhilidi () to attack Northern Wei, and Tuoba Gui, despite having a much smaller army than Liu Zhilidi, defeated him, and further crossed the Yellow River to attack Liu Wenchen's capital Yueba (悅拔, in modern Ordos, Inner Mongolia), capturing it, forcing Liu Wenchen and Liu Zhilidi to flee. The next day, Liu Wenchen was killed by his subordinates, and Liu Zhilidi was captured. Tuoba Gui annexed Liu Wenchen's territory and people into his own, and slaughtered Liu Wenchen's clan and associates—more than 5,000 people. Liu Wenchen's youngest son Liu Bobo, however, fled to the Xuegan () tribe, whose chief Tai Xifu () refused to turn him over despite Northern Wei demands, and Liu Bobo would eventually marry the daughter of Later Qin's vassal Mo Yigan () and became dependent on him. To punish Tai Xifu, Tuoba Gui attacked him in 393 and slaughtered much of his tribe, although Tai Xifu himself fled.