Emperor Han Xuandi 漢宣帝 (r. 74-49 BCE), personal name Liu Bingji 劉病已, later changed to Liu Xun 劉詢, courtesy name Ciqing 次卿 or Mou 謀, was a ruler of the Former Han dynasty 前漢 (206 BCE-8 CE). He was a great-grandson of Emperor Wu and a grandson of Liu Ju 劉據, Crown Prince Li 戾太子. Emperor Zhao's 漢昭帝 (r. 87-74 BCE) direct successor was Prince Liu He 劉賀, who was demoted for his improper behaviour after only one months of rule. Instead, Liu Bingji was chosen as the new emperor, in spite of his humble way of life.
His parents had been discarded from the imperial house in the context of a sorcery affair at the court of Emperor Wu, but Liu Bingji was saved by censor Bing Ji 丙吉 and grew up like a commoner and knew the life of the common people. At that time he also became accustomed with both the laissez-faire concept of the Huang-Lao school 黄老 and that of a harsh penal law of the legalists. With the age of 18 sui, he was first given the title of Marquis of Yangwu 陽武侯 and was then made emperor.
He was suggested to marry the daughter of the powerful minister and regent Huo Guang 霍光, but he preferred to make a girl of humble origin his consort, Empress Xu 許皇后. Yet the wife of Huo Guang soon poisoned Empress Xu, so that Huo's daughter would become empress.
In 68 BCE Huo Guang died, which enabled Emperor Xuan to personally take over regency. He made Liu Shi 劉奭, his son with late empress Xu, heir apparent.
In 66 BCE the members of the Huo family planned to overthrow Emperor Xuan, but the attempt failed, and a lot of persons of the Huo were executed, including Huo's wife. Empress Huo committed suicide and was replaced by a new consort, Lady Wang 王氏. Emperor Xuan's own fate during his childhood was only reveiled to him in 63 BCE, and he highly rewarded the people that once had helped him and his family to escape execution. Bing Ji, now Censor-in-chief (yushi dafu 御史大夫), was made Marquis of Boyang 博陽侯.
Emperor Xuan convoked a Confucian conference in the Shiqu Hall 石渠閣 where the differences between the old-text and new-text classics were to be discussed. The emperor personally supervised the conference because he was inspired by the Confucian concept of a benevolent government. He relaxed corporal punishment and lowered taxes, and so helped increasing the economical output in the empire.
In the Western Territories 西域, he established a protectorate (duhufu 都護府) that secured this region against the steppe federation of the Xiongnu 匈奴. Their khan (chanyu 單于) Huhanya 呼韓邪 declared his submission and sent tributes to the Han court.
Emperor Xuan was buried in the tomb mound Duling 杜陵. He was succeeded by his son Liu Shi, known as Emperor Yuan 漢元帝 (r. 49-33 BCE).