The Jin dynasty 晉 (265-420) was a ruling house founded by Sima Yan 司馬炎 (Emperor Wu 晉武帝, r. 265-289). The Jin were the successor dynasty of the Wei dynasty 曹魏 (220-265) in China's north, and conquered the last of the Three Kingdoms 三國 (220-280), the empire of Wu 吳 (222-280), in southern China. The territory of the Jin empire covered the whole of China proper and in the beginning extended even to the Western Territories 西域 (modern Xinjiang).
The Jin period is divided into two parts, the Western Jin Xijin 西晉 (265-316) and the Eastern Jin period Dongjin 東晉 (317-420). During the Western Jin, the imperial capital was Luoyang 洛陽 (modern Luoyang, Henan). The weak central government could not control the activities of the many non-Chinese tribes that had in the last century settled down in northern China. Exploited by the local gentry and landowners, communities of foreign peoples like the Xiongnu 匈奴, Xianbei 鮮卑 or Tanguts (Di 氐) rose in rebellion, and their leaders founded their own states that are known as the Sixteen Kingdoms of the Five Barbarian Peoples 五胡十六國 (300~430). At the same time, northern China was brought into turmoil by internecine struggles among the many princes of the Jin dynasty. The rebellion of the Eight Princes brought turmoil to the whole of northern China, and when the capital Luoyang was conquered by the Xiongnu chieftain Liu Yao 劉曜 (r. 318-329), a ruler of the "barbarian" Former Zhao dynasty 前趙 (304-329), the court fled to the southwest. Emperor Yuan 晉元帝 (r. 317-322) founded a new capital in Jiankang 建康 (modern Nanjing 南京, Jiangsu). The northern aristocracy had to arrange their with the powerful local magnates of the lower Yangtse area, and the dynastic family Sima was never able to gain a foothold in southern China. The Eastern Jin dynasty was therefore only the precursor of a series of dynasties that would eventually reign over southern China, the so-called Southern Dynasties 南朝. Among the members of the Jin period aristocracy many famous writers and poets were to be found. Buddhism and Daoism flourished as popular religions and gradually won also followers among the aristocracy.