During the First Great Qiang Rebellion (107–118) in Liang Province,[2] unrest also spread to the Hanzhong and Wudu commanderies.[1]
In 188, Liu Yan was appointed governor of Yi Province.[3] Upon his death in 194, Yi passed to his son Liu Zhang.[4]
In 213, warlord Cao Cao conquered the city of Hanzhong from the Taoist cult leader Zhang Lu, and threatened the rest of Yi. Liu Zhang requested the help of warlord Liu Bei, a relative of his, but the latter turned against Zhang, conquered most of Yi Province, and proclaimed the Kingdom of Shu.[4] During the subsequent Hanzhong Campaign (217–219), Liu Bei was able to conquer Hanzhong from Cao Cao and thus complete his control over Yi Province. In 221, Liu Bei assumed the title of emperor.