In January 239, the Cao Wei emperor
Cao Rui died and was succeeded by his seven-year-old adopted son,
Cao Fang. Before his death, Cao Rui named General-in-Chief
Cao Shuang and Grand Commandant
Sima Yi as regents to assist Cao Fang. Cao Shuang wanted to dominate the Wei government, so he used a series of political manoeuvres to consolidate and concentrate power in the hands of himself, his brothers Cao Xi (曹羲) and Cao Xun (曹訓), and their supporters. He heeded the advice of
He Yan,
Deng Yang and Ding Mi (丁謐), and relocated
Empress Dowager Guo (Cao Rui's widow) to Yongning Palace (永寧宮) so that she could not interfere in politics. He also put his brothers in command of the military, promoted his close aides to higher positions in the imperial court, and made changes to the political structure to benefit himself and his clique. Sima Yi tried to stop Cao Shuang but failed to do so. Cao Shuang became increasingly distrustful and wary of Sima Yi. In June or July 247, Sima Yi claimed that he was ill and withdrew from the political scene. At the time, there was a saying in Luoyang which went: "He (Yan), Deng (Yang) and Ding (Mi) create turmoil in the imperial capital." In April or May 248, Zhang Dang (張當), a palace
eunuch, illegally transferred 11 women out of the imperial harem and presented them to Cao Shuang to be his concubines. Cao Shuang and his close aides thought that Sima Yi was seriously ill and could no longer do anything, so they plotted with Zhang Dang to overthrow the emperor Cao Fang and put Cao Shuang on the throne. However, they were still wary of Sima Yi and did not lower their guard against him. At the time,
Li Sheng, one of Cao Shuang's supporters, had been recently reassigned to be the Inspector of
Jing Province. Cao Shuang secretly instructed him to check if Sima Yi was as ill as he claimed, so Li Sheng visited Sima Yi before leaving for Jing Province. Sima Yi knew the true purpose of Li Sheng's visit, so he pretended to be frail and feeble. Li Sheng saw that Sima Yi could not move around and wear clothes without help from his servants, and could not even consume
congee without soiling his clothes. He then told Sima Yi, "Everyone thought that your illness was a minor one; alas, who expected you to be in such poor health?" Sima Yi pretended to cough and pant as he replied, "I'm old and sick and I'm going to die soon. When you go to
Bing Province, you should be careful because it is near barbarian territory. We might not see each other again, so I entrust my sons
Shi and
Zhao to your care." Li Sheng said, "I'm returning to my home province, not Bing Province." Sima Yi pretended to mishear and he said, "You're going to Bing Province, aren't you?" Li Sheng then said, "My home province is Jing Province." Sima Yi replied, "I'm so old and weak that I can't even hear you. So now you're going back to your home province. It's time for you to make some glorious achievements!" Li Sheng returned to Cao Shuang and told him, "Sima Yi is dying soon and no longer of sound mind. There's nothing for you to worry about." Later, he said, "It's sad to see that the Grand Tutor is no longer in a good state of health to serve." Cao Shuang lowered his guard against Sima Yi. ==The ''coup d'état''==