Hanzhong Campaign
In 219, Liu Bei emerged victorious in the Hanzhong Campaign and proclaimed himself "King of Hanzhong" (). He appointed Zhang Fei as General of the Right (). Liu Bei later planned to return to Chengdu and he wanted to leave a veteran general behind to guard Hanzhong. Many people believed that Zhang Fei would receive this responsibility and even Zhang Fei himself thought so too. However, to everyone's surprise, Liu Bei chose Wei Yan instead and appointed him as the Administrator of Hanzhong.