In 215, Sima Yi accompanied Cao Cao on his campaign against the warlord Zhang Lu, whom Cao Cao defeated in Hanzhong Commandery at the Battle of Yangping, and afterwards Sima Yi urged him to capitalise on the momentum to press on and attack his rival, Liu Bei, who was in the neighbouring Yi Province. Sima Yi pointed out that since Liu Bei had only recently seized control of Yi Province from Liu Zhang, he had yet to establish a strong foothold in the province. However, Cao Cao rejected Sima Yi's idea and said that he was already content with having Longyou (隴右; covering parts of present-day Gansu and Shaanxi). He then turned his attention towards his other key rival, Sun Quan.