After Cao Wei ended in 265, Cao Fang was created "Duke" of Shaoling County by of the . When he died in 274, he was given the rather unflattering posthumous name "Duke Li of Shaoling."
Cao Fang was probably born in 231, into a princely household of Cao Wei royalty and adopted by the emperor Cao Rui at a young age, perhaps as an infant. It is not conclusively known who his parents were, although official histories themselves speculated that he was the son of Cao Kai , the Prince of Rencheng, who was the son of Cao Zhang and grandson of Cao Cao. Cao Kai was therefore a cousin of the emperor, and his son would be in the right generation to be an adopted son of Cao Rui. He had an adoptive brother, Cao Xun , who might have been born in 230 and who was adopted with him, but for reasons unknown Cao Rui favored Cao Fang.
In 235, both Cao Fang and his brother Cao Xun were created princes by their adoptive father -- Cao Fang was created the Prince of Qi, while Cao Xun was created the Prince of Qin.
Around the new year of 239, when Cao Rui grew ill, he resolved to pass the throne to Cao Fang. He initially wanted to entrust Cao Fang to his uncle Cao Yu , to serve as the lead regent, along with Xiahou Xian , Cao Shuang, Cao Zhao , and Qin Lang . However, his trusted officials Liu Fang and Sun Zi were unfriendly with Xiahou and Cao Zhao and were apprehensive about their becoming regents, and managed to persuade him to make Cao Shuang and Sima Yi (who was then with his troops at Ji regents instead. Cao Yu, Cao Zhao, and Qin were excluded from the regency.
Half a month later, as Cao Rui neared death, Sima finally arrived at Luoyang. Cao Rui held Sima's hand and summoned Cao Fang and Cao Xun to his bedside, and then pointed Cao Fang out for Sima and told Cao Fang to hug Sima's neck. He then created Cao Fang crown prince and died the same day.
Cao Fang would have the longest reign in Cao Wei's history, but during no time did have real imperial authority. During his reign, the political scene was first dominated by Cao Shuang, then by Sima Yi, and eventually, when Cao Fang tried to resist the power grab by Sima Yi's son Sima Shi, he was deposed by Sima Shi.
Under Cao Shuang's regency
Initially, Cao Shuang and Sima Yi shared power, but Cao Shuang quickly used a number of political maneuvers to honor Sima with honorific titles while stripping his actual power. Cao Shuang then made all important decisions and stopped consulting Sima. Quickly, Cao's associates, including Deng Yang , Li Sheng , He Yan , and Ding Mi , who were known for their talents but lack of wisdom, all became powerful, and they excluded other officials who would not associate with them from positions of power. Sima was still given military authority , but no real authority on governance.
In 243, Cao Fang married his first wife, , a granddaughter of his grandmother Zhen Luo's brother Zhen Yan .
In 244, Cao Shuang, who wanted to garner for himself a military reputation as well, made a major attack against Shu Han's major border city of Hanzhong , without careful logistics planning. The battles themselves were inconclusive, but after Cao Wei forces ran out of food supplies, Cao Shuang was forced to withdraw at great loss of life. Despite his failure on the battlefield, however, Cao Shuang held onto power firmly. In 247, Sima, upset at his actual powerlessness, claimed that he was ill and retired from government service.
In 249, Sima made his move in an coup later known as the Incident at Gaoping Tombs. While Cao Fang and Cao Shuang were outside the capital on an official visit to Cao Rui's tomb, Sima, with support from a number of anti-Cao Shuang officials, claiming to have an order from to do so, closed all city gates of Luoyang and submitted a report to Cao Fang, accusing Cao Shuang of dominating and corrupting the government and demanding that Cao Shuang and his brothers be deposed. Cao Shuang was stricken with panic and did not know how to react, and even though his senior advisor Huan Fan recommended that he take Cao Fang to the secondary capital Xuchang and then resist Sima with his troops, Cao chose to surrender his troops and powers, under promise by Sima that he would still be able to maintain his titles. However, Sima soon reneged on the promise and had Cao Shuang and his associates, as well as their clans, executed on charges of treason.
Under Sima Yi's regency
After Sima Yi's takeover, he carefully but inexorably removed people who were actual or potential threats to his authority. Very quickly he established what his intent would be -- by having Cao Fang offer to grant him the nine bestowments -- a sign of a coming usurpation -- and then declining it. The 18-year-old Cao Fang was left with little power. Sima, however, had the support of the people by removing corruption and ineffiency that characterized Cao Shuang's regency and promoting a number of honest officials.
In 249, the powerful general Wang Ling, who was in charge of the key southeastern city of Shouchun began to plan a revolt against Sima's hold on power, in association with Cao Biao , the Prince of Chu and a son of Cao Cao . In 251, Wang was ready to carry out his plans when his associates Huang Hua and Yang Hong leaked the plan to Sima. Sima quickly advanced east before Wang could be ready and promised to pardon him. Wang knew that he was not ready to resist, so he submitted, but Sima again reneged on his promise and forced Wang and Cao Biao to commit suicide. Wang's clan and the clans of his associates were all slaughtered. Sima died later that year, but Cao Fang still could not recover any power, as power became firmly held by Sima's son Sima Shi.
Also in 251, Empress Zhen died.
Removal by Sima Shi
Sima Shi was a capable politician and administrator, but he also quickly wanted to prove his military reputation. In 252, he made a major attack against Eastern Wu, whose founding emperor Sun Quan had recently died and whose current emperor, Sun Liang, was under the regency of Zhuge Ke. Zhuge was able to deal Sima's forces a major blow, but Sima maintained himself well by making humble admissions of faults to the public and promoting the generals who tried to stop his campaign. In 253, after Sima defeated Zhuge in a major battle, his reputation was established, while Zhuge's own was undermined , and Zhuge soon fell while Sima's power was affirmed.
In 254, Sima made a violent move to consolidate his power, at Cao Fang's expense. Cao Fang had endeared himself to the minister Li Feng, and there had been suspicious by Sima that they were plotting against him. He summoned and interrogated Li, and when Li refused to disclose his conversations with the emperor, Sima beat him to death with a sword handle and then accused Li and his friends Xiahou Xuan and Zhang Qi of treason, and had them and their clans executed. Cao Fang was further forced to depose his wife , who was Zhang Ji's daughter. He created to succeed her.
Cao Fang was very angry about the deaths of Li and Zhang, and later in 254, his associates submitted a plan to him -- that when Sima's brother Sima Zhao would arrive at the palace for an official visit before heading to his defense post at Chang'an, to kill Sima Zhao and seize his troops, and then use those troops to attack Sima Shi. Cao Fang was apprehensive and paralyzed, and did not implement the plan, but news was still leaked to Sima Shi. Sima Shi then forcibly deposed Cao Fang, although sparing his life and giving him his old title of the Prince of Qi.
After Cao Fang was removed, he was given a palace in Henei , but it was likely that he was under virtual house arrest. After Sima Zhao's son Sima Yan usurped the throne in 265, thus ending Cao Wei and establishing , Cao Fang, along with all Cao Wei princes, was reduced in rank to Duke . He died in 274 and was presumably buried with the ceremonies due a duke, rather than an emperor. There were no records of any descendants.
* Adoptive father
** Cao Rui
* Biological father
** Rumored to be Cao Kai , Prince of Rencheng, son of Cao Zhang, Prince Wei of Rencheng, son of Cao Cao