The first of the two periods, the Western Jìn Dynasty , was founded by , better known as Sima Yan. Although providing a brief period of unity after conquering the state of Eastern Wu in 280, the Jìn could not contain the invasion and uprising of nomadic peoples after the devastating War of the Eight Princes. The capital was Luoyang until 311 when was captured by the forces of Han Zhao. Successive reign of lasted four years in Chang'an until its conquest by Han Zhao in 316.
Meanwhile remnants of the Jìn court fled from the north to the south and reestablished the Jìn court at Jiankang, south-east of Luoyang and Chang'an and near modern-day Nanjing, under Prince of Longya. Prominent local families of Zhu, Gan, Lu, and Zhou supported the proclamation of Prince of Langye as of the Eastern Jìn Dynasty when the news of the fall of Chang'an reached the south.
Militaristic authorities and crises plagued the Eastern Jìn court throughout its 104 years of existence. It survived the rebellions of Wang Dun and Su Jun. Huan Wen died in 373 before he could usurp the throne . Battle of Fei turned out to be a victory of Jìn under a short-lived cooperation of Huan Chong, brother of Huan Wen and the Prime Minister Xie An. Huan Xuan, son of Huan Wen, usurped and changed the name of the dynasty to Chu. He was toppled by , who ordered the strangulation of the reinstated but retarded . The last emperor and brother of Emperor An, , was installed in 419. Abdication of Emperor Gong in 420 in favor of Liu Yu, then , ushered in the Liu Song Dynasty and the Southern Dynasties.
Meanwhile North China was ruled by the Sixteen Kingdoms, many of which were founded by the Wu Hu, the non-Han Chinese ethnicities. The conquest of the Northern Liang by the Northern Wei Dynasty in 439 ushered in the Northern Dynasties.