Cao Fang (232–274), courtesy name Lanqing, was the third emperor of the state of Cao Wei during the Three Kingdoms period. He was an adopted son of Cao Rui, the second ruler of Wei. Cao Fang ruled from 239 to 254 as a nominal emperor before he was deposed by the regent Sima Shi, after which he became known as the "Prince of Qi". After the fall of Wei in 265, Cao Fang was conferred the title of "Duke of Shaoling" by Emperor Wu of the Jin dynasty. When he died in 274, he was granted the posthumous name "Li", so his full posthumous title became "Duke Li of Shaoling".
Around 239, when Cao Rui became ill, he resolved to pass the throne to Cao Fang. Initially, he wanted to entrust Cao Fang to his uncle Cao Yu (曹宇), who would serve as a regent along with Xiahou Xian (夏侯獻), Cao Shuang, Cao Zhao (曹肇), and Qin Lang (秦朗). However, Cao Rui's trusted officials Liu Fang (劉放) and Sun Zi (孫資) were not on good terms with Xiahou Xian and Cao Zhao, and were apprehensive about them becoming regents. Eventually, Cao Rui was persuaded to appoint Cao Shuang and Sima Yi. Cao Yu, Cao Zhao and Qin Lang were excluded from the regency.
Half a month later, when Cao Rui was on his deathbed, Sima Yi arrived at Luoyang. Cao Rui held onto Sima's hand and summoned Cao Fang and Cao Xun (another adopted son of Cao Rui) to his bedside. He pointed out Cao Fang and told the boy to hug Sima, as he would hug his father. Cao Rui then instated Cao Fang as crown prince and died on the same day.
Although Cao Fang ruled for the longest period of time of all the rulers of Cao Wei, he was not in control of state power at any time during his reign. During his reign, the political scene was dominated by regents - Cao Shuang initially; then Sima Yi after he seized power from Cao Shuang during the Incident at Gaoping Tombs. After Sima Yi's death, Cao Fang attempted to take back state power from Sima Yi's son, Sima Shi, but was not successful and was eventually deposed by Sima Shi.
Under Cao Shuang's regency
Cao Shuang and Sima Yi initially shared state power when they ruled as regents, but over time, Cao gradually stripped off Sima's power. He requested for Sima to be promoted to higher appointments and granted honorific titles, but the holder of these appointments and titles do not wield any power. After that, Cao Shuang made all important decisions and stopped consulting Sima. Many of Cao's associates, such as Deng Yang (鄧颺), Li Sheng (李勝), He Yan (何晏), and Ding Mi (丁謐), were appointed as high-ranking officials. Those not associated with Cao were excluded from holding positions in the imperial court. Sima was granted military authority, including command in defending Cao Wei from Eastern Wu's attack in 241, but he had no real authority on governance.
In 244, Cao Shuang led an attack on Shu Han's border city of Hanzhong, without careful planning, hoping that he would gain a reputation in the military. The battles were inconclusive and Cao was forced to withdraw with great losses when their food supplies ran out. Despite this failure, Cao continued to hold on to state power firmly. In 247, Sima Yi retired from government service, claiming that he was ill.
In 249, Sima launched a coup to seize power from Cao Shuang. While Cao Fang and Cao Shuang left the capital Luoyang to visit Cao Rui's tomb, Sima rallied a group of anti-Cao Shuang officials and closed all gates of Luoyang. He sent an edict to Cao Fang in the name of Empress Dowager Guo, accusing Cao Shuang of dominating and corrupting the government, and demanding that Cao Shuang and his brothers be removed from power. Cao Shuang eventually decided to surrender his authority, against the advice of Huan Fan. Sima promised Cao Shuang that he could still retain his titles. However, not long later, Sima had Cao Shuang and his family and associates executed on charges of treason. By then, Sima Yi was in complete control of the government.
Under Sima Yi's regency
After Sima Yi took over as regent, he carefully but inexorably eliminated his political opponents. Cao Fang, under coercion by Sima's supporters, offered Sima the nine bestowments, but Sima declined. During Sima's regency, he eliminated inefficiency and corruption that characterized Cao Shuang's time, and many honest officials were promoted on Sima's recommendation.
In 249, Wang Ling, the general in charge of the southeastern city of Shouchun (present-day Shou County, Lu'an, Anhui), plotted a rebellion against Sima Yi, in association with Cao Biao (曹彪), the Prince of Chu. In 251, when Wang was ready to carry out his plan, his subordinates Huang Hua (黃華) and Yang Hong (楊弘) betrayed him to Sima. Sima led an army to Shouchun before Wang could take action, and promised to pardon Wang for rebelling. Wang surrendered and was forced to commit suicide together with Cao Biao later. Wang's clan and followers were also slaughtered. Sima Yi died later that year and was succeeded by his son Sima Shi as regent, who continued wielding state power.
Deposal by Sima Shi
In 252, Sima Shi led a campaign against Eastern Wu, whose founding emperor Sun Quan had recently died, and the current ruler Sun Liang was under Zhuge Ke's regency. Although Sima was defeated, he maintained himself well by publicly admitting his faults and promoting the generals who advised him against the campaign. In 253, Sima defeated Zhuge Ke in a major battle and established a reputation in the military.
In 254, Sima made a violent move to consolidate power at the expense of Cao Fang. Cao Fang had endeared himself to the minister Li Feng, and Sima suspected that they were plotting against him. Sima summoned and interrogated Li, who refused to disclose his conversations with the emperor. Sima beat Li to death with a sword handle and accused Li and his associates Xiahou Xuan and Zhang Ji (張緝) of treason, and had them and their clans exterminated. Cao Fang was forced to depose Empress Zhang (Zhang Ji's daughter) and replace her with Empress Wang.
Cao Fang was angry with Sima Shi about the deaths of Li Feng and Zhang Ji. Later in 254, his supporters proposed a plan for him to seize power from Sima Shi: when Sima Shi's brother Sima Zhao arrived at the palace for an official visit before heading to Chang'an, Cao Fang would kill Sima Zhao and take control of his troops, and use those troops to attack Sima Shi. Cao Fang was apprehensive and hesitated in implementing the plan. Sima Shi heard about the plot and removed Cao Fang from the throne. Cao's life was spared and he was demoted to his previous title of Prince of Qi.
Later life and death
After his deposal, Cao Fang was moved to a palace in Henei (present-day Jiaozuo, Henan). When Sima Zhao's son Sima Yan usurped the throne of Cao Wei in 265 and established the Jin Dynasty, Cao Fang and other Cao Wei princes were demoted to the status of dukes. He died in 274 and was posthumously granted the title of "Duke Li of Shaoling", with a funeral befitting that of a duke instead of an emperor. He did not have any known descendants.
- Zhengshi (正始) 240–249
- Jiaping (嘉平) 249–254
- Informal titles
- Emperor Shao of Wei (魏少帝; lit. "young emperor of Wei")
- Emperor Fei of Wei (魏廢帝; lit. "deposed emperor of Wei")
- Posthumous titles
- Prince Ai of Qi (齊哀王)
- Duke Li of Shaoling (邵陵厲公)