The Han dynasty (, ; ) was an imperial dynasty of China (202 BC – 9 AD, 25–220 AD), established by Liu Bang and ruled by the House of Liu. The dynasty was preceded by the short-lived Qin dynasty (221–207 BC) and a warring interregnum known as the ChuHan contention (206–202 BC), and it was succeeded by the Three Kingdoms period (220–280 AD). The dynasty was briefly interrupted by the Xin dynasty (9–23 AD) established by usurping regent Wang Mang, and is thus separated into two periods—the Western Han (202 BC – 9 AD) and the Eastern Han (25–220 AD). Spanning over four centuries, the Han dynasty is considered a golden age in Chinese history, and it has influenced the identity of the Chinese civilization ever since. Modern China's majority ethnic group refer to themselves as the "Han people" or "Han Chinese". The Sinitic language and written Chinese are referred to respectively as the "Han language" and "Han characters".
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. The Han Empire was divided into areas directly controlled by the central government called commanderies, as well as a number of semi-autonomous kingdoms. These kingdoms gradually lost all vestiges of their independence, particularly following the Rebellion of the Seven States. From the reign of Emperor Wu ( BC) 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 1912 AD.
The Han dynasty saw an age of economic prosperity and witnessed a significant growth of the money economy first established during the Zhou dynasty ( BC). The coinage issued by the central government mint in 119 BC remained the standard coinage of China until the Tang dynasty (618–907 AD). The period saw a number of limited institutional innovations. To finance its military campaigns and the settlement of newly conquered frontier territories, the Han government nationalized the private salt and iron industries in 117 BC, though these government monopolies were later repealed during the Eastern Han dynasty. Science and technology during the Han period saw significant advances, including the process of papermaking, the nautical steering ship 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 that could be used to discern the cardinal direction of distant earthquakes.
The Han dynasty is known for the many conflicts it had with the Xiongnu, a nomadic steppe confederation to the dynasty's north. The Xiongnu initially had the upper hand in these conflicts. They defeated the Han in 200 BC and forced the Han to submit as a de facto inferior and vassal partner for several decades, while continuing their military raids on the dynasty's borders. This changed in 133 BC, during the reign of Emperor Wu, when Han forces began a series of intensive military campaigns and operations against the Xiongnu. The Han ultimately defeated the Xiongnu in these campaigns, and the Xiongnu were forced to accept vassal status as Han tributaries. Additionally, the campaigns brought the Hexi Corridor and the Tarim Basin of Central Asia under Han control, split the Xiongnu into two separate confederations, and helped establish the vast trade network known as the Silk Road, which reached as far as the Mediterranean world. The territories north of Han's borders were later overrun by the nomadic Xianbei confederation. Emperor Wu also launched successful military expeditions in the south, annexing Nanyue in 111 BC and Dian in 109 BC. He further expanded Han territory into the northern Korean Peninsula, where Han forces conquered Gojoseon and established the Xuantu and Lelang Commanderies in 108 BC.
After 92 AD, the palace eunuchs increasingly involved themselves in the dynasty's court politics, engaging in violent power struggles between the various consort clans of the empresses and empresses dowager, 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 ( AD), 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.