Jin, the Sixteen Kingdoms, and the Northern and Southern Dynasties Though these three kingdoms were reunited temporarily in 280 by the (Western) Jin Dynasty , the contemporary non-Han Chinese (Wu Hu,) ethnic groups controlled much of the country in the early 4th century and provoked large-scale Han Chinese migrations to south of the Chang Jiang . In 303 the Di people rebelled and later captured Chengdu. Under Liu Yuan the Xiongnu rebelled near today Linen County. His successor Liu Cong captured and executed the last two Western Jin emperors. Sixteen kingdoms were established by these ethnic groups. The chaotic north was temporarily unified by Fu Jian who was defeated at the Battle of Feishui when he attempted to invade the south of China. Later on, Emperor Taiwu of Northern Wei reunified the north again, marking the beginning of the Northern Dynasties, a sequence of local regimes ruling over the regions north of Chang Jiang.
Along with the refugees from the North, Emperor Yuan of Jin China reinstated the Jin regime at present Nanjing in the south. From this came the sequence of Southern dynasties of Song, Qi, Liang and Chen, which all had their capitals at Jiankang (near today Nanjing). As China was ruled by two independent dynasties, one in the south and the other in the north, this is called the era of Southern and Northern Dynasties.