Cao Pi (曹丕),[4] courtesy name Zihuan (子桓), was the first emperor of the state of Cao Wei in the Three Kingdoms period of China. He was the second son of Cao Cao, a warlord who lived in the late Eastern Han dynasty, but the eldest son among all the children born to Cao Cao by his concubine (later wife), Lady Bian. After the defeat of Cao Cao's rival Yuan Shao at the Battle of Guandu, he took Yuan Xi's widow, Lady Zhen, as a concubine, but in 221 Lady Zhen died and Guo Nüwang became empress.
On 25 November 220, Cao Pi forced Emperor Xian, the last ruler of the Eastern Han dynasty, to abdicate in his favour, after which on 11 December 220, he proclaimed himself emperor and established the state of Cao Wei. Cao Pi continued the wars against the states of Shu Han and Eastern Wu, founded by his father's rivals Liu Bei and Sun Quan respectively, but did not make significant territorial gain in the battles. After Cao Pi's death, his successor Cao Rui granted him the posthumous name "Emperor Wen" and the temple name "Shizu".