The great army arrived at Dingjun Mountain. Huang Zhong saw that the mountain was steep and dangerous, making it difficult to capture quickly. Fa Zheng said: 'We should first seize the terrain and block the main roads. If the enemy rashly advances, we can attack them.' Huang Zhong Following the plan, at the foot of Dingjun Mountain, they camped by the mountain and river, sending soldiers daily to provoke the enemy. Xiahou Yuan, relying on his bravery, wanted to go into battle but was stopped by Zhang He. After a few days, Huang Zhong feigned defeat and retreated, luring Xiahou Yuan to leave his camp and pursue. Xiahou Yuan indeed fell for the trap and led his troops in pursuit. Unexpectedly, Huang Zhong had laid an ambush along the way, decisively defeating Xiahou Yuan, who retreated back to Dingjun Mountain. Huang Zhong's morale soared, and he pressed the attack, advancing straight to the foot of the mountain.
Fa Zheng climbed a height to observe and saw that Xiahou Yuan's army was demoralized. Noticing Xiahou Yuan was impatient, he was sure that Xiahou Yuan would personally come out to supervise the battle. Then he said to Huang Zhong: 'Now we should conserve our strength. Wait until they are exhausted before launching an attack. I observe that Xiahou Yuan will personally come out tomorrow to repair the deer antlers (defensive barriers). General, you can take him by surprise and finish him in one fell swoop!' Huang Zhong Acting on the advice, they held their position and waited for the next day. The next day, as expected, Xiahou Yuan personally came out to oversee the repair of the deer antlers. At that moment, Fa Zheng saw from afar and immediately ordered Huang Zhong to attack.
Huang Zhong heard the drum and was filled with vigor. Mounted on his horse and wielding a single blade, he charged straight ahead. Xiahou Yuan had no time to prepare. Caught off guard, he was split in two by Huang Zhong with a single angry roar and a flash of his blade. Thus, Dingjun Mountain was seized by Huang Zhong. When Cao Cao heard the news of Xiahou Yuan's death, he was furious and personally led a large army to seize Hanzhong. Liu Bei and Zhuge Liang were fully prepared for the defense. Cao Cao repeatedly attacked without success. Additionally, his provisions were running low, his soldiers were exhausted, and morale wavered. Furthermore, Yang Xiu was executed by Cao Cao for seeing through the meaning of the phrase 'chicken rib'. In the end, Cao Cao was caught in a dilemma and had no choice but to lead his troops back to Chang'an. Thus, Liu Bei completely took over the Hanzhong region. He declared himself the King of Hanzhong, established his government and appointed officials, and enfeoffed the Five Tiger Generals. For a time, his prestige and power shook the world.