It is not known when Xiahou Zi was born. His family was from Qiao (譙, in modern
Bozhou,
Anhui) and claimed ancestry from the
Spring and Autumn period state
Qi, but little is known about his traceable ancestry except for his father Xiahou Shen (夏侯審), who served as a supervisory official at the
ministry of rites. Xiahou Zi had at least two older brothers, Xiahou Min (夏侯敏) and Xiahou Jing (夏侯敬), and at least two younger brothers, Xiahou Fei (夏侯斐) and Xiahou Ao (夏侯敖). Xiahou Zi passed the
imperial examinations in the
Jinshi class in 826, during the reign of
Emperor Jingzong. He subsequently served on staffs of various regional governors, before later successively serving as the prefect of Wu Prefecture (婺州, in modern
Jinhua,
Zhejiang) and the prefect of Jiang Prefecture (絳州, in modern
Yuncheng, Shanxi). He was later recalled to the capital
Chang'an to serve as an advisory official with the title
Jianyi Daifu (諫議大夫), and later as an imperial attendant (給事中,
Jishizhong). In 856, by which time Emperor Jingzong's uncle
Emperor Xuānzong was emperor, Xiahou was made the deputy minister of justice (刑部侍郎,
Xingbu Shilang). In 857, he made
Shangshu You Cheng (尚書右丞), one of the secretaries general of the executive bureau of government (尚書省,
Shangshu Sheng), and given the honorific title of
Shang Zhuguo (上柱國). Soon thereafter, he was also made the deputy minister of census (戶部侍郎,
Hubu Shilang) and the director of taxation — after Emperor Xuānzong had initially offered the position to the mayor of
Jingzhao Municipality (京兆, i.e., the Chang'an region), Wei Ao (韋澳) but Wei declined. == First chancellorship ==