In 226, Cao Pi led his armies to attack Sun Quan and left Sima Yi behind to defend and govern the imperial capital in his absence, as well as providing reinforcements and supplies for his armies at the frontline. Before departing, Cao Pi issued a decree: "I am deeply concerned about what happens after I die. This is why I entrust you with this responsibility. Even though Cao Shen made many contributions on the battlefield, Xiao He played a more important role than him. Can I be free of worries I have about the west (referring to the rival state Shu in the west)?" Cao Pi later returned from Guangling Commandery to Luoyang and he told Sima Yi: "When I am in the east, you will be in charge of the west; when I am in the west, you will be in charge of the east." Sima Yi remained behind to guard Xuchang.