Chinese emperors family tree (early)
Emperor Xian, the last emperor of the Han dynasty, was a descendant of the first emperor Liu Bang. Lasting for over 400 years (the first to last for more than a century), the Han Dynasty is regarded as one of the golden ages of Chinese history. The Han Dynasty was interrupted by the reign of the usurper Wang Mang, who declared the Xin dynasty (9–23 AD); on this basis, the Han Dynasty is generally divided into the Western Han (206 BC – 9 AD and 23–25 AD) and the Eastern Han (25–220 AD). The rulers of the Shu Han, one of the three successor states to the Han Dynasty during the Three Kingdoms period, were descended from the Han imperial family, and considered themselves a continuation of the Han Dynasty; they are included below.
End of the Han dynasty
Cao Cao died in March 220 and his son Cao Pi inherited the title of "King of Wei" without waiting for formal authorization from Emperor Xian. In the winter of 220, Emperor Xian sent the Imperial Seal to Cao Pi and issued an edict announcing that he was abdicating in favour of Cao Pi. Cao Pi formally declined to accept the throne thrice but obliged eventually. The Han dynasty officially ended at that point and Cao Pi established the state of Cao Wei in its place, moving the capital from Xu back to Luoyang. The dethroned Emperor Xian was granted a title of "Duke of Shanyang".