Liu Bei and Xiahou Yuan have by the spring of 219 faced each other for over a year.
Liu Bei leads the main army to the south of the Mian River and orders Huang Zhong to set up camps on Mount Dingjun, where Xiahou Yuan's encampment in the valley below could be easily monitored.
One night, Liu Bei sends ten thousand troops to attack Zhang He in Guangshi and sets fire to Xiahou Yuan's barricades.
Xiahou Yuan then leads a small detachment to put out the fire and sends the main army to reinforce Zhang He.
Fa Zheng sees an opportunity for attack and signals to Liu Bei to launch an assault.
Liu sends Huang Zhong to attack the weakened enemy from above.
Huang Zhong targets Xiahou Yuan's unit and completely routs it.
Both Xiahou Yuan and Zhao Yong, Cao Cao's appointed Inspector of Yi Province, ae killed in the battle.
Zhang He, who had been informally elected to succeed Xiahou Yuan by Du Xi and Guo Huai, retreats to the northern bank of the Han River, and awaits Cao Cao's reinforcement.
Meanwhile, Liu Bei secures all strategic points at the exit of the passes linking Chang'an and Hangzhong while Cao Cao is approaching via Yegu Pass.
Liu Bei faces Cao Cao for several months but never engages the latter in battle, effectively forcing Cao to retreat as his soldiers start to desert.
Zhang He also retreats to Chencang to set up defenses for a potential invasion by Liu Bei.
Liu Bei leads his main army to Nanzheng and sends Meng Da and Liu Feng to capture Fangling and Shangyong.