In 280 AD, the Western Jin Dynasty destroyed Wu and unified the country. But soon after, Xiao Qiang was troubled and the "Eight Kings Rebellion" broke out. The harsh policies imposed on the five ethnic minorities who migrated inland, including the Xiongnu, Xianbei, Jie, Di, and Qiang, aggravated social conflicts and triggered large-scale peasant uprisings. In the wave of peasant uprisings, the Western Jin Dynasty finally perished in October 316. Then the rulers of various ethnic groups in the north established nearly 20 countries, collectively known as the "Sixteen Kingdoms".
To escape the war, people in the north moved southward. In 317, Sima Rui, a member of the Western Jin Dynasty royal family, established a political power in Jiankang, which is now Nanjing, Jiangsu Province, and was known as the "Eastern Jin Dynasty" in history. The Eastern Jin Dynasty settled in the south of the Yangtze River and had no intention of expedition to the north. In 420, Liu Yu usurped Jin and established the Song Dynasty. Over the next 160 years, the south experienced four dynasties: Song, Qi, Liang and Chen, collectively known as the "Southern Dynasties". The north is experiencing unprecedented ethnic integration. In 439, the Xianbei people established the Northern Wei Dynasty to unify the Yellow River Basin. The Northern Wei Dynasty later split into two parts: Eastern and Western. Soon, the Eastern Wei Dynasty was replaced by the Northern Qi Dynasty, and the Western Wei Dynasty was replaced by the Northern Zhou Dynasty. This is the "Northern Dynasties". The Northern and Southern Dynasties coexisted and were collectively called the "Southern and Northern Dynasties".
In 577, the Northern Zhou Dynasty destroyed the Northern Qi Dynasty. In 581, Yang Jian usurped the Zhou Dynasty and established the Sui Dynasty. In 589, the Sui Dynasty destroyed Nanchen and unified the country.