In 214, after Liu Bei seized control of Yi Province (covering present-day Sichuan and Chongqing) from the warlord Liu Zhang, he appointed Liu Yan as the Administrator of Guling Commandery (固陵郡; a.k.a. Badong Commandery 巴東郡; covering parts of present-day Chongqing).