Around 211, Liu Bei led an army from Jing Province to Yi Province (covering present-day Sichuan and Chongqing) to assist the provincial governor Liu Zhang in countering a rival warlord, Zhang Lu, in Hanzhong Commandery. In 212, when conflict broke out between Liu Bei and Liu Zhang, the former led his forces from Jiameng () to attack the latter, leaving behind Huo Jun to defend Jiameng. At the same time, Zhang Lu sent his subordinate Yang Bo () to trick Huo Jun into losing Jiameng by offering to defend Jiameng together with Huo. Huo Jun replied Yang Bo, "You can take a "xiaoren"'s head but not a fortress." Yang Bo retreated. Later, Liu Zhang sent his officers Fu Jin (), Xiang Cun () and others to lead an army of ten thousands to attack Jiameng. Huo Jun had only a few hundred troops with him but he managed to hold his position for a year. When he saw that the ennemy was weak and negligent, he selected elite soldiers from among his men and launched a counterattack on Liu Zhang's forces, greatly defeated them and beheading Xiang Cun in battle.