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 the 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. On 29 May 243, Cao Fang married
Empress Zhen, a granddaughter of his grandmother
Lady Zhen's brother Zhen Yan (). 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 (
Battle of Xingshi). 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 February 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, a few days 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, 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 in September 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 had 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==