During the late Northern Wei, many groups rose in rebellion against the dynasty in and around Youzhou. Wang Huiding's rebellion of 494 lasted one month. In 514, Shramana Liu Shaozeng led a Buddhist rebellion in You Prefecture. In 524, Xianbei military families in the Six Frontier Towns rebelled against the Northern Wei and were crushed with the assistance of Rouran chieftain Yujiulü Anagui. The Northern Wei resettled 200,000 residents from the frontier towns to Hebei, where a local famine quickly prompted the migrants to rebel again under the leadership of Du Luozhou in 525. Du Luozhou led the rebels from Shanggu (modern-day Huailai) south through the Juyong Pass and defeated Wei troops north of Youzhou and eventually captured the city. In 528 Wei troops under Erzhu Rong's subordinate, Hou Yuan, retook the city from rebel leader Han Lou.