In 217, Fa Zheng urged Liu Bei to attack Hanzhong Commandery, which was originally under Zhang Lu's control but was conquered by Cao Cao in 215. He pointed out Hanzhong's strategic importance and said that it was an opportune moment for Liu Bei to seize Hanzhong from Cao Cao's generals Xiahou Yuan and Zhang He. Liu Bei accepted his plan and started the Hanzhong Campaign.