Xiahou Shang (died May or June 226), courtesy name Boren, was a Chinese military general and politician of the state of Cao Wei during the Three Kingdoms period of China. He was a distant younger relative of Xiahou Yuan and a close friend of Cao Pi, the first emperor of the Cao Wei state. Early life Xiahou Shang was a distant younger relative of Xiahou Yuan and Xiahou Dun, generals who served under Cao Cao, the warlord who rose to power in the late Eastern Han dynasty and laid the foundation for the Cao Wei state in the Three Kingdoms period. As a youth, he was already known for being well-versed in planning and strategy. Cao Pi, one of Cao Cao's sons, highly regarded Xiahou Shang and treated him as a close friend. Service under Cao Cao In the 200s, when Cao Cao was at war with his rival Yuan Shao for control over northern China, Xiahou Shang served as a major () in Cao Cao's army and led cavalry forces into battle against Yuan Shao and his heirs. In 211, after Cao Pi was appointed General of the Household for All Purposes () in the Han imperial court, Xiahou Shang served as a wenxue (文學; an officer of writings) under him. In 213, after Emperor Xian, the figurehead emperor of the Han Empire, enfeoffed Cao Cao as the Duke of Wei (), Xiahou Shang was reassigned to be a Gentleman of the Yellow Gate () in Cao Cao's dukedom. In 216, Emperor Xian elevated Cao Cao from the status of a duke to a vassal king under the title "King of Wei" (). When the Wuchendi () branch of the Wuhuan tribes started a rebellion in Dai Commandery (代郡; around present-day Yu County, Hebei) and Shanggu Commandery (上谷郡; around present-day Beijing) in May 218, Cao Cao ordered his son Cao Zhang to lead forces to quell the revolt. During this time, Xiahou Shang served as an army adviser () under Cao Zhang and assisted him in defeating the Wuchendi. Service under Cao Pi In March 220, after Cao Cao died in Luoyang, Xiahou Shang received orders to lead the convoy escorting Cao Cao's coffin back to Ye (鄴; in present-day Handan, Hebei), the capital of the vassal Kingdom of Wei, for a proper funeral and burial. Cao Pi, as Cao Cao's heir apparent, succeeded his father as the King