Emperor Xuan of Han (; 91 BC – 10 January 48 BC), born Liu Bingyi (劉病已), was the tenth emperor of the Han dynasty, reigning from 74 to 48 BC, and was one of the only four Western Han emperors to receive a temple name (along with Emperor Gaozu, Emperor Wen and Emperor Wu). During his reign, the Han dynasty prospered economically and militarily became a regional superpower, and was considered by many to be the peak period of the entire Han history. His time of rule, along with his predecessor Emperor Zhao's are known by historians as Zhaoxuan Restoration (昭宣中興). He was succeeded by his son Emperor Yuan after his death in 48 BC.

Emperor Xuan's life story was a riches-to-rags-to-riches story. He was born a prince as a great-grandson of Emperor Wu. His grandfather Liu Ju, was a son of Emperor Wu and Empress Wei and the crown prince of the Han Empire, who in 91 BC was framed for witchcraft practice against Emperor Wu and committed suicide after being forced into a failed uprising. His father Liu Jin () also died in that turmoil, along with the rest of his family. Emperor Xuan was only a months-old infant at the time and only survived due to the protection of the sympathetic prison warden Bing Ji, and lived his youth as a commoner after being released by a nationwide amnesty from Emperor Wu in 87 BC. After Liu He's short 27-day reign in 74 BC, the 17-year-old Liu Bingyi was selected by Huo Guang (the half-brother of Liu Bingyi's great-cousin Huo Qubing) for the throne, inheriting the crown that ironically would have been his anyway if his grandfather's rebellion in 91 BC hadn't happened.

Emperor Xuan of Han

Emperor Xuan has been considered a hardworking and brilliant ruler by historians. Because he grew up among commoners, he thoroughly understood the suffering of the grassroot population, and lowered taxes, liberalized the government and employed capable ministers to the government. He was said by Liu Xiang to have been fond of reading the works of Shen Buhai, using Xing-Ming to control his subordinates and devoting much time to legal cases. Emperor Xuan was open to suggestions, was a good judge of character, and consolidated his power by eliminating corrupt officials, including the Huo family who had exerted considerable power since the death of Emperor Wu, after Huo Guang's death. However, his execution of the entire Huo clan later drew heavy criticism from historians (e.g. Sima Guang in his Zizhi Tongjian) for being "ungrateful" to the late Huo Guang.

Emperor Xuan of Han

Family background and early life

Parentage, disaster, and a barely spared young life

Liu Bingyi was born in 91 BC to Liu Jin, the son of then-Crown Prince Liu Ju, and his wife Consort Wang. As the grandson of the Crown Prince, Bingyi likely was born in Prince Ju's palace.

Emperor Xuan of Han

That same year, however, disaster would strike. With conspirators accusing him of using witchcraft against his father Emperor Wu, Prince Ju was forced into a rebellion, which Prince Ju was defeated. Prince Ju committed suicide, and Bingyi's two uncles died with him, although it was not clear whether they also committed suicide or were killed by soldiers. Bingyi's great-grandmother Empress Wei also committed suicide, and his grandmother (Prince Ju's concubine) Consort Shi and his parents died in the incident as well in the capital Chang'an. It is not completely clear whether they took their own lives or were executed, but the latter seems likely.

For reasons not completely clear, baby Bingyi was spared, but was imprisoned in a prison overseen by the Ministry of Vassal Affairs. He was put into the custody of the warden Bing Ji (). Bing knew that Prince Ju was actually innocent of witchcraft and took pity on the child, and selected two kind female prisoners, Hu Zu () and Guo Zhengqing () to serve as his wet nurses and caretakers. Bing Ji visited them each day to see how the child was doing.