The Western Han dynasty ends when Wang Mang claims that the divine Mandate of Heaven called for the end of the dynasty and the beginning of his own, the Xin dynasty.
The Xin dynasty (; Chinese: ; pinyin: Xncho; WadeGiles: Hsin-chao; lit. 'New dynasty') was a short-lived Chinese dynasty which lasted from 9 to 23 AD, established by the Han dynasty consort kin Wang Mang, who usurped the throne of Emperor Ping of Han and the infant "crown prince" Ruzi Ying to rule the empire over a decade before being overthrown by rebels. After Wang's death, the Han dynasty was restored by Liu Xiu, a distant descendant of the Emperor Jing of Han; therefore, the Xin dynasty is often considered an interregnum period of the Han dynasty, dividing it into the Western Han (or "Former Han") and the Eastern Han (or "Later Han").
The Han dynasty (Chinese: 漢朝; pinyin: Hàncháo) was the second imperial dynasty of China (202 BC – 220 AD), established by Liu Bang and ruled by the House of Liu. Preceded by the short-lived Qin dynasty (221–206 BC) and a warring interregnum known as the Chu–Han contention (206–202 BC), it was briefly interrupted by the Xin dynasty (9–23 AD) established by the usurping regent Wang Mang, and was separated into two periods—the Western Han (202 BC – 9 AD) and the Eastern Han (25–220 AD)—before being succeeded by the Three Kingdoms period (220–280 AD). Spanning over four centuries, the Han dynasty is considered a golden age in Chinese history, and influenced the identity of the Chinese civilization ever since. Modern China's majority ethnic group refers to themselves as the "Han people", the Sinitic language is known as "Han language", and the written Chinese is referred to as "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 using an innovation inherited from the Qin 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. From the reign of Emperor Wu (r. 141–87 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 (c. 1050–256 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, but these government monopolies were 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 Xiongnu, a nomadic steppe confederation, defeated the Han in 200 BC and forced the Han to submit as a de facto inferior and vassal partner for several decades, but continued their military raids on the Han borders. Emperor Wu 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 and control into the Tarim Basin of Central Asia, divided 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 quickly 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, and in the Korean Peninsula where the Xuantu and Lelang Commanderies were established in 108 BC. After 92 AD, the palace eunuchs increasingly involved themselves in 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 (r. 168–189 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.