Cao Rui () (204 or 205 – 22 January 239), courtesy name Yuanzhong, was the second emperor of the state of Cao Wei during the Three Kingdoms period. His parentage is in dispute: his mother, Lady Zhen, was Yuan Xi's wife, but she later remarried Cao Pi, the first ruler of Wei. Based on conflicting accounts of his age, Pei Songzhi calculated that, in order to be Cao Pi's son, Cao Rui could not have been 36 (by East Asian age reckoning) when he died as recorded, so the recorded age was in error; late-Qing scholars Lu Bi (卢弼) and Mao Guangsheng (冒广生) argued instead that Cao Rui was Yuan Xi's son.
Cao Rui's reign was viewed in many different ways throughout Chinese history. He devoted many resources into building palaces and ancestral temples, and his reign saw the stalemate between his empire, Shu Han, and Eastern Wu become more entrenched. His building projects and his desire to have many concubines (who numbered in the thousands) greatly exhausted the imperial treasury.
On his deathbed, he had no biological son. He passed the throne to his adopted son Cao Fang and entrusted him to the regency of Cao Shuang and Sima Yi. This would prove to be a fatal mistake for his clan, as Cao Shuang monopolised power and governed incompetently, eventually drawing a violent reaction from Sima Yi, who overthrew him in a coup d'état (Incident at the Gaoping Tombs). Sima Yi became in control of the Wei government from February 249, eventually allowing his grandson Sima Yan to usurp the throne in February 266. After his death, Cao Rui was posthumously honoured as "Emperor Ming" with the temple name "Liezu".
When Cao Rui was born (likely in 205), his grandfather Cao Cao was the paramount warlord of the Han dynasty, who had rendered Emperor Xian of Han a mere figurehead. His father Cao Pi was Cao Cao's oldest surviving son and the heir apparent. His mother Lady Zhen had been the wife of Yuan Shao's son Yuan Xi, but when she was seized by Cao Cao's army in c.mid-September 204, Cao Pi forced her to marry him, and she gave birth to Cao Rui only eight months after the wedding—leading to theories that Cao Rui was actually biologically Yuan Xi's son and not Cao Pi's. However, Cao Cao was fond of this grandson, and frequently ordered Rui to be at his side. Cao Cao even said, "It is because of you (Cao Rui) that my achievements can last three generations." Cao Pi, after his father's death in March 220, forced Emperor Xian to yield the throne to him and established Cao Wei in December of that year. Lady Zhen was not allowed to accompany him to the new capital Luoyang; in August 221, he forced her to commit suicide.
Because of what happened to Lady Zhen and Cao Rui's unclear origin, even though Cao Rui was the oldest of Cao Pi's sons, he was not created crown prince early in his father's reign, but was only created the Prince of Pingyuan in March 222. Sometime during his years as the Prince of Pingyuan, he married a daughter of an aristocrat, Lady Yu, as his wife and princess. He apparently had a cordial relationship with Lady Guo, who was created empress (in October 222); as she was sonless, his status as heir apparent was not seriously challenged. It is said that any thoughts that Cao Pi had at not making him heir was dissipated by a hunt; during that hunt, Cao Pi and Cao Rui had encountered a mother deer and a young deer. Cao Pi killed the mother deer with an arrow, and then ordered Cao Rui to kill the young deer. Cao Rui wept and said, "Your imperial majesty had already killed the mother, and I do not have the heart to kill the son as well." Cao Pi dropped his bow and arrows and became mournful.
In June 226, when Cao Pi became ill, he finally created Cao Rui crown prince. He died soon thereafter, and Cao Rui became emperor at the age of 21.
Cao Rui's reign was a paradoxical one in many ways. He was clearly intelligent and capable, and yet never fulfilled his potential in his governance of the country or in his military campaigns. He showed great compassion at times, and yet was capable of great cruelty. He carried out many acts that were beneficial for the empire and yet at least as many that were hurtful. Despite his uncle Cao Zhi's successive petitions, however, he continued the severe prohibitions against princes' holding of offices that his father Cao Pi had put in place, and this was commonly viewed by traditional historians as an eventual factor in the downfall of Cao Wei, as the Simas took power after Cao Rui's death without the imperial princes having any real ability to oppose them.
Cao Rui, a young adult when he became emperor, quickly showed a knack for finding capable officials to empower while maintaining steady control over them. His father had appointed three regents for him—his distant cousin Cao Zhen, the steady administrator Chen Qun, and the shrewd strategist Sima Yi. Once Cao Rui became emperor, however, he, while knowing the value of the advice of these senior officials, chose perhaps the best path to deal with them: honoring them and making them regional governors with full authority in the provinces they governed. By doing this, he showed that he was his own man while at the same time continued to receive the wisdom of their advice.
Throughout Cao Rui's reign, he showed great diligence in seeking out advice from multiple officials, rather than concentrating on listening to several, before making important decisions. He was generally cautious and not willing to take risks, but at the same time was, therefore, able to avoid major disasters for his empire.
One immediate threat that Cao Rui had to deal with after he became emperor were attacks from Shu Han's chancellor, Zhuge Liang. Zhuge had, after the death of Shu Han's founding emperor, Liu Bei, initially taken a passive posture militarily with regards to the Shu Han-Cao Wei border, while re-establishing an alliance with Sun Quan's Eastern Wu, in order to rest the people and the troops. In 227, he, under the theory that Shu Han was naturally a weaker state than Cao Wei and, if it had just sat and done nothing, would eventually be swallowed up by Cao Wei anyway, started a series of five northern campaigns.
During these campaigns, Cao Rui's response generally was to head to the metropolitan Chang'an—a politically important city that Wei could not afford to lose—and then commission generals to the frontlines to ward off Zhuge's attacks. This strategy had the effect of boosting the morale of the troops and shortening the communication line. Being fairly quickly updated as to the events at the frontlines, Cao Rui could also keep the central empire under his watch. Ultimately, Zhuge's campaigns were futile; after his death in 234, his plan was largely abandoned by his successors Jiang Wan and Fei Yi. However, that did not mean that there was peace on the borders with Shu Han, as nearly every year, there would be battles between the two states. However, there would be no major confrontations on the scale of Zhuge's campaigns for the rest of Cao Rui's reign.
During Cao Rui's reign, there were also many battles waged against the other rival empire, Eastern Wu. The very first came only two months after Cao Rui had become emperor in June 226. It was during that campaign that Cao Rui showed his acumen for judging a situation correctly—believing that by the time that reinforcements could be sent, Eastern Wu's monarch Sun Quan would have already withdrawn, and therefore sending reinforcements was pointless. Throughout his reign, he would generally take a similar stance during campaigns against Eastern Wu as he did with Shu Han—head east personally to be close to the theater of the war, while remaining some distance away from the frontlines, which also proved to be effective. He also entrusted the southeastern border to the capable Man Chong, and Man's stewardship averted many disasters.
Cao Rui's greatest military loss came in 228, when the Eastern Wu general Zhou Fang tricked Cao Rui's distant cousin and regional governor Cao Xiu into believing that he was ready to surrender his troops to Cao Wei, while instead laying a trap for Cao Xiu. Instead of realizing that it was indeed a trap, Cao Rui enthusiastically approved Cao Xiu's plan, and this led to a major military disaster, but Cao Xiu's forces were saved by Jia Kui from total annihilation.