In 217, Liu Bei started a campaign to seize control of Hanzhong Commandery, which was under Cao Cao's control. His force encountered resistance led by Xiahou Yuan at Yangping Pass. The confrontation dragged on for more than a year until one night in 219, when Liu Bei set fire to the barbed fence around Xiahou Yuan's camp at the foot of Mount Dingjun. Alarmed by the attack, Xiahou Yuan sent Zhang He to defend the eastern corner of the camp while he guarded the south. Liu Bei's main force pressed against Zhang He, outmatching the latter. Xiahou Yuan dispatched a fraction of his own troops to help Zhang He. Huang Zhong rallied his men and, accompanied by thundering drums, they descended upon Xiahou Yuan's dwindling force. The battle became a rout and Xiahou Yuan was killed in action. The victory at Mount Dingjun was a major stepping stone to the conquest of Hanzhong. Huang Zhong was promoted to General Who Attacks the West (征西將軍) for his contributions in the Hanzhong Campaign.