Emperor Xian of Han
Cao Cao died on 15 March 220. His son and successor, Cao Pi, soon forced Emperor Xian to abdicate the throne in favour of himself, ending the Han dynasty. Cao Pi established a new state known as Cao Wei (sometimes known inaccurately as the Kingdom of Wei), and he granted Emperor Xian a noble title – Duke of Shanyang (山陽公). The former Emperor Xian died in 234 and was buried with honours befitting an emperor, using Han ceremonies, and the then emperor of Wei, Cao Rui, was one of the mourners. As Emperor Xian's crown prince was already dead, his grandson Liu Kang (劉康) inherited his dukedom, which lasted for 75 more years and two more dukes, Liu Jin (劉瑾) and Liu Qiu (劉秋), until the line was exterminated by invading Xiongnu tribes in about 309, during the Jin dynasty. This practice of an emperor conferring hereditary nobility on his predecessor, from whom he usurped the throne, was known as "er wang san ke" (二王三恪).
Han dynasty
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, 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 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.