Cao Pi (187 – 29 June 226), courtesy name Zihuan, was the first emperor of the state of Cao Wei in the Three Kingdoms period. He was born in Qiao (譙; present-day Bozhou, Anhui) as the second son of Cao Cao, a warlord who lived in the late Eastern Han Dynasty. However, he was the eldest son among all the children born to Cao Cao by his concubine (later wife) Lady Bian. Of all his brothers, Cao Pi was the shrewdest. Instead of focusing on academic studies or administering military affairs, he was always in the presence of court officials in order to gain their support. He was mostly in charge of defence at the start of his career. After the defeat of Cao Cao's rival Yuan Shao at the Battle of Guandu, he took the widow of Yuan Shao's son Yuan Xi, Lady Zhen, as a concubine, but in 221 Lady Zhen died and Guo Nüwang became empress.
In 220, Cao Pi forced Emperor Xian, the last ruler of the Han Dynasty, to abdicate the throne to him, and 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. Unlike his father, Cao Pi concentrated most of his efforts on internal administration rather than on waging wars against his rivals. During his reign, he formally established Chen Qun's nine-rank system as the base for civil service nomination, which drew many talents into his government. On the other hand, he drastically reduced the power of princes, stripping off their power to oppose him, but at the same time, rendering them unable to assist the emperor if a crisis arose within the state. After Cao Pi's death, his successor Cao Rui granted him the posthumous name "Emperor Wen" and the temple name "Shizu".
Cao Pi was also an accomplished poet and scholar, just like his father Cao Cao and his younger brother Cao Zhi. He wrote Yan Ge Xing (燕歌行), the first Chinese poem in the style of seven syllables per line (七言詩). He also wrote over a hundred articles on various subjects.