History of the Jin dynasty (266–420)
The Jin dynasty (266–420) was one of China's most crucial dynasties. Following the devastation of the Three Kingdoms period, the Jin unified those territories and fostered a brief period of prosperity between 280 and 304 CE. However, during this period many social problems developed as well, the most pressing of which was the migration of barbarian tribes into Jin territory, to the point where they outnumbered Han Chinese in some regions. Eventually, these tribes began the Wu Hu uprising, during which they took control of much of North China, China's heartland at  that time, and reduced Jin control to the territory south of the Huai River. This ended the prosperity of the early Jin. The Jin dynasty was afterwards known as the Eastern Jin. The Eastern Jin's government was dominated to a large extent by powerful generals such as Wang Dun and Huan Wen. These generals often launched expeditions to recover northern China from Wu Hu rule. However, internal division in the government and military, coupled with the weakness of the Southern economy, meant that these expeditions were mostly unsuccessful. By 383 CE, Jin China was threatened by the Former Qin  Empire, which had reunified all of North China. Instead of reconquering the North, Jin was fighting for its very survival. However, in the Battle of Fei River, Jin forces prevailed over the much larger Qin army, causing the collapse of Former Qin in the North. Taking advantage of this, Jin forces under first Xie An and then Liu Yu launched a series of expeditions that retook much of China's territory south of the Yellow River, the traditional heartland. Eventually, though, the Jin were overthrown by Liu Yu in 420, ending the dynasty. Rise of the Jin. Foundation. The Jin  dynasty was founded by the Sima family, a prominent family within Cao Wei, the most powerful of China's Three Kingdoms. They effectively controlled Cao Wei's military forces after 250, becoming the real rulers of the state. In 265 CE, the last Wei emperor abdicated and gave up his throne to Sima Yan, who became the first Jin emperor. Conquest of Wu. As Emperor Wu of Jin, Sima Yan immediately focused on conquering the last of the Three Kingdoms, Wu, which controlled southeastern China. In 280 CE, 200,000 Jin troops in six columns, travelling by river and land, invaded  Wu from both Sichuan and the North. They quickly broke through all resistance, including an attempt by Wu's chancellor Zhang Di to stop them with 30,000 troops. Very soon, Jin forces were besieging the Wu capital, Nanjing, which had only 20,000 defenders. Realizing he was doomed, the Wu ruler surrendered to Jin, and China was reunified. Prosperity of the Taikang Era. During the rule of Emperor Wu, China entered an era of prosperity. The Jin encouraged recovery by lowering taxes and subsidizing the construction of dikes and other works to benefit agriculture. The reunification of China also spurred on  trade to help stimulate the economy. This prosperity was reflected in the growing luxury of the emperor. One official reportedly entertained Emperor Wu with pork that had been fed on human milk, while another spent over 20,000 strings of cash each day on food alone. This decadence was criticized by other Jin officials, who also worried about increasing barbarian migration into China. Fall of the Western Jin. War of the Eight Princes. Emperor Wu believed that Wei's fall had been caused by the royal family losing power and support. To prevent this in his own dynasty, he appointed many  of his brothers and sons as "kings" of individual provinces, in effect creating a series of powerful regional governments alongside the central government. Consequently, following Emperor Wu's death, control of his weak heir Emperor Hui of Jin was fought over by the regional princes in the devastating War of the Eight Princes (301-305 CE), severely weakening the Jin. Wu Hu uprising. Following the War of the Eight Princes, the barbarian tribes in north China, under the collective Wu Hu, saw an opportunity to take advantage of the chaos in China. Their forces, under Liu Yuan, revolted against the  Jin in 304 CE. Although Jin forces fought hard to contain Wu Hu uprising, they suffered a major defeat in 310 CE that wiped out an army of over 100,000 troops, and afterwards could not hold north China. In 311 CE, the Wu Hu sacked the Jin capital, Luoyang, killing over 30,000 people, and Jin's secondary capital, Chang'an, was also captured in 316 CE. The Middle Jin (316–383). Internal crisis. The remaining followers of the Jin dynasty retreated south and formed the Eastern Jin, whose control was limited to South China. Throughout this period, the Jin court was severely  weakened, allowing the Eastern Jin to be dominated by strong generals such as Wang Dun and Huan Wen. Special "commanderies of immigrants" and "white registers" were created for the massive amount of northern origin Han Chinese who moved south during the Eastern Jin dynasty. The southern Chinese aristocracy was formed from the offspring of these migrants. Celestial Masters and the nobility of northern China subdued the nobility of southern China during the Eastern Jin and Western Jin in Jiangnan in particular. The most populous region of China was southern China after the depopulation of the north and the migration of  northern Chinese to southern China. Different waves of migration of aristocratic Chinese from northern China to the south at different times resulted in distinct groups of lineages, with some lineages arriving in the 300s-400s and others in the 800s-900s. Huan Wen's expeditions. Huan Wen, who effectively controlled the Jin state from 346 CE to 373 CE, launched a series of expeditions against the Wu Hu, in an attempt to strengthen both the Jin and his own prestige. However, most of these expeditions failed due to lack of supplies and the Jin court's suspicion of Huan Wen. The Late  Jin (383–420). Battle of Fei River. By 376 CE, the North had been reunified under the state of Former Qin, putting Jin in grave danger. In 383 CE, Fu Jian, ruler of Former Qin, invaded Jin with 300,000 troops, against which the Jin could only deploy 80,000 troops. However, the Chinese troops were well-trained and equipped, while the Qin army was made up mostly of conscripts. In the Battle of Fei River, the Qin army was routed by the Jin army. After this victory, Chancellor Xie An, taking advantage of Former Qin's collapse, reclaimed much of the territory  north of the Huai River for Jin. However, a rebellion by Huan Wen's son Huan Xuan distracted the Jin, who were unable to defeat it until the rise of Liu Yu. Liu Yu's expeditions. Usually regarded as the best general of the Southern and Northern dynasties, Liu Yu defeated the regime of Huan Xuan in 406 CE. He then launched a series of expeditions against Later Qin, Xia, Southern Yan, and Northern Wei, all of which succeeded with the exception of Xia. These victories allowed the Chinese to retake the heartland of China and fixed their northern border  at the Yellow River. Following these victories, Liu Yu's prestige rose, to the point where he usurped the Jin throne in 420 CE, ending the dynasty. Under the rule of him and his son, China would enter a brief golden age, lasting until the Xianbei again conquered north China during the rule of Emperor Ming of Liu Song. Imperial Family. Sima Fei (司馬朏) was a descendant of the Jin dynasty royalty who fled north to the Xianbei Northern Wei in exile and married the Xianbei Princess Huayang (華陽公主), the daughter of Emperor Xiaowen of Northern Wei. When the Eastern  Jin dynasty ended Northern Wei received the Jin prince Sima Chuzhi 司馬楚之 as a refugee. A Northern Wei Princess married Sima Chuzhi, giving birth to Sima Jinlong 司馬金龍. Northern Liang Xiongnu King Juqu Mujian's daughter married Sima Jinlong. The Song dynasty chancellor Sima Guang (1019–1086) was descended from the Jin Imperial family.