Cao Pi usurps the Han, Cao Cao

During his lifetime, many people urged him to simply depose Emperor Xian of Han and declare himself emperor, but Cao Cao refused. After his death, Cao Pi inherited the title of King of Wei, while also serving as Chancellor and Governor of Ji Province. Seeing that his father had already laid a solid foundation, Cao Pi decided to fulfill his father's unfinished wish himself.

At that time, the imperial court had many officials surnamed Cao, which caused resentment among other ministers. To ease the conflict between the scholar-official class and the Cao clan, Cao Pi adopted Chen Qun's proposal and implemented the Nine-Rank System, appointing impartial officials to evaluate the merits of all officials without favoritism. He also established the Central Secretariat, staffed by members of the scholar-official class, and transferred the duty of drafting imperial edicts from the Imperial Secretariat to this new body. He decreed that eunuchs could not interfere in state affairs, that women of the imperial harem could not meddle in politics, that ministers could not petition the Empress Dowager on government matters, and that relatives of the imperial consorts could not hold power. These measures successfully won the support of the scholar-official class, laying the foundation for Cao Pi's eventual ascension to the throne.

In October of the year 220 AD, Cao Pi forced Emperor Xian of Han to surrender the imperial seal and abdicate the throne to him, then declared himself emperor before the realm, establishing the state of Wei with the reign title Huangchu, making Luoyang the capital, and posthumously honoring his father Cao Cao as Emperor Wu of Wei. The founding of Wei ended the over four-hundred-year rule of the Han Dynasty, and Cao Pi became the first monarch to claim the title of emperor during the Three Kingdoms period.

After Cao Pi ascended the throne, he successively issued a series of policies. In 221 AD, he ordered that every county with a population of one hundred thousand must annually recommend one person through the recommendation system to serve in the imperial court; he also extensively renovated the Confucian Temple and enfeoffedConfuciusLater generations established the Marquis of Zongsheng, and in 224 AD, restored the Imperial Academy, promoted Confucianism throughout the country, and established the position of Doctor of the Spring and Autumn Annals and Guliang Commentary in the court; after making Luoyang the capital, he ordered the repair of buildings destroyed during the wars, creating a good living environment for the people; he continued the tuntian system of agricultural colonies, encouraged people to reclaim wasteland, set up marketplaces to facilitate trade and exchange, and stabilized the market economy; politically, Cao Pi not only established the Nine-Rank Zhongzheng system but also reclaimed power from many feudal princes, thereby strengthening central authority.

In border defense affairs, Cao Pi also made significant achievements. The Qiang and Hu peoples in the Hexi region frequently invaded, so Cao Pi ordered troops to suppress them, defeating the Qiang and Hu forces and restoring peace to the Hexi area. Additionally, the Xianbei repeatedly raided the northern border, but after several crackdowns, they gradually ceased their incursions, stabilizing the northern frontier. Cao Pi also sent envoys to the Western Regions and, following the example of the Eastern Han Dynasty, established a Chief Clerk's Office there to manage affairs of the various states in the Western Regions and maintain communication between the region and the Central Plains.

After learning that Cao Pi had declared himself emperor, Sun Quan wrote a letter pledging allegiance to Wei in order to preserve his strength. Cao Pi granted him the title of King of Wu, and initially the two states maintained friendly relations, but after several twists and turns, they ultimately became enemies. Cao Pi personally led troops to attack Eastern Wu three times, but unfortunately each campaign ended in failure.

Cao Pi ruled the Wei Kingdom for six years, during which the state enjoyed social stability, an improved standard of living for the people, ample national funds, and abundant military supplies, largely eliminating the harms brought by the war-torn era. However, compared to his father Cao Cao, there remained a significant gap in both political and military achievements, with his only notable accomplishments being in literature. His poem "Yan Ge Xing" is considered the earliest existing seven-character poem by a literati in China, and he also wrote a critical essay "Dian Lun · Lun Wen," which is a highly important critical work in Chinese literary history and the first specialized essay in Chinese literary history. Besides seven-character poetry, Cao Pi was also skilled in five-character regulated verse and yuefu poetry, with a style that is mostly fresh and pleasing.

In 226 AD, after three failed campaigns against Eastern Wu, Cao Pi fell gravely ill and died shortly thereafter. On his deathbed, he appointed Cao Zhen and Sima Yi among others as regent ministers to support Crown Prince Cao Rui's ascension to the throne.