The Han Dynasty (simplified Chinese: 汉朝; traditional Chinese: 漢朝; pinyin: Hàn Cháo; Wade–Giles: Han Ch'ao; IPA: [xân tʂʰɑ̌ʊ̯]; 206 BCE – 220 CE) was the second imperial dynasty of China, preceded by the Qin Dynasty (221–206 BCE) and succeeded by the Three Kingdoms (220–265 CE). It was founded by the peasant rebel leader Liu Bang, known posthumously as Emperor Gaozu of Han. It was briefly interrupted by the Xin Dynasty (9–23 CE) of the former regent Wang Mang. This interregnum separates the Han into two periods: the Western Han (206 BCE – 9 CE) and Eastern Han (25–220 CE). Spanning over four centuries, the period of the Han Dynasty is considered a golden age in Chinese history. To this day, China's majority ethnic group refers to itself as the "Han people".
The Han Empire was divided into areas directly controlled by the central government, known as commanderies, and a number of semi-autonomous kingdoms. These kingdoms gradually lost all vestiges of their independence, particularly following the Rebellion of the Seven States. The Xiongnu, a nomadic confederation which dominated the eastern Eurasian Steppe, defeated the Han army in battle in 200 BCE. Following the defeat, a political marriage alliance was negotiated in which the Han became the de facto inferior partner. When, despite the treaty, the Xiongnu continued to raid Han borders, Emperor Wu of Han (r. 141–87 BCE) launched several military campaigns against them. The ultimate Han victory in these wars eventually forced the Xiongnu to accept vassal status as Han tributaries. These campaigns expanded Han sovereignty into the Tarim Basin of Central Asia and helped establish the vast trade network known as the Silk Road, which reached as far as the Mediterranean world. Han forces managed to divide the Xiongnu into two competing nations, the Southern and Northern Xiongnu, and forced the Northern Xiongnu across the Ili River. Despite these victories, the territories north of Han's borders were quickly overrun by the nomadic Xianbei Confederation.
After 92 CE, the palace eunuchs increasingly involved themselves in court politics, engaging in violent power struggles between the various consort clans of the empresses and empress dowagers, causing the Han's ultimate downfall. Imperial authority was also seriously challenged by large Daoist religious societies which instigated the Yellow Turban Rebellion and the Five Pecks of Rice Rebellion. Following the death of Emperor Ling (r. 168–189 CE), the palace eunuchs suffered wholesale massacre by military officers, allowing members of the aristocracy and military governors to become warlords and divide the empire. When Cao Pi, King of Wei, usurped the throne from Emperor Xian, the Han Dynasty ceased to exist.
The Han Dynasty was an age of economic prosperity and saw a significant growth of the money economy first established during the Zhou Dynasty (c. 1050–256 BCE). The coinage issued by the central government mint in 119 BCE remained the standard coinage of China until the Tang Dynasty (618–907 CE). To pay for its military campaigns and the settlement of newly conquered frontier territories, the government nationalized the private salt and iron industries in 117 BCE. These government monopolies were repealed during the Eastern Han period, and the lost revenue was recouped through heavily taxing private entrepreneurs. The emperor was at the pinnacle of Han society. He presided over the Han government but shared power with both the nobility and appointed ministers who came largely from the scholarly gentry class. From the reign of Emperor Wu onward, the Chinese court officially sponsored Confucianism in education and court politics, synthesized with the cosmology of later scholars such as Dong Zhongshu. This policy endured until the fall of the Qing Dynasty in 1911 CE. Science and technology during the Han period saw significant advances, including papermaking, the nautical steering rudder, the use of negative numbers in mathematics, the raised-relief map, the hydraulic-powered armillary sphere for astronomy, and a seismometer employing an inverted pendulum.