In the power struggle between Cao Shuang and Sima Yi, the latter enjoyed much greater fame due to the successful defensive campaign against Zhuge Liang. Cao Shuang desperately needed a great military victory to boost his fame to match that of Sima Yi, and Cao Shuang's protégés Deng Yang and Li Sheng suggested to him that launching a campaign against Shu Han was the way. Despite strong oppositions, Cao Shuang believed that this was viable, especially when Jiang Wan, the Shu Han commander withdrew his main force from Hanzhong to Fu County in October, 243. Cao Shuang and his protégés concluded that with numerical superiority, Cao Wei could easily take Hanzhong before Shu Han reinforcements could arrive, and it not completely destroy Shu Han, the taking of Hanzhong along would be sufficient enough to boost the support, popularity and fame of Cao Shuang's camp. As it turned out, Cao Wei had greatly underestimated the enemy.
The three traditional passages from Hanzhong to Guanzhong were all valleys in the Qinling Mountains. Meridian Trail in the east is the longest, totalling more than 330 km, with its northern end located to the south of Chang'an. The southern half of the valley was called Zi Valley and the northern half was called Wu Valley. The rugged local terrain provided numerous spots that were perfect for ambushes, and whoever sets up ambushes could easily completely annihilate the opposing side travelling in the valley, and thus this longest route was also the most dangerous. However, if Shu Han was on the offensive, it could easily threaten Chang'an by taking this route, and that was the exact suggestion Wei Yan proposed to Zhuge Liang in the latter’s . The 235 km long Baoxie Trail located in the west had the best road condition among all three traditional passages, with the northern half called Xie Valley and the south half Bao Valley. The southern end of the Baoxie Trail was located around 25 km north of Hanzhong, while its northern end was located 15 km to the south of present day Mei County of Shaanxi. In the center of Baoxie Trail , another valley called Winnowing Basket Valley branched out westward, and then turned northward, eventually ending near Chencang , a strategic stronghold that would be threatened if Shu Han was on the offensive. If Cao Wei was on the offensive and took the initiative by going out actively engaging the enemy, the good road condition would mean that Shu Han could deploy their defensive force quicker and stop the attack before Cao Wei force could get out of the valley.
The 210 km long Tangluo Trail in the center was the shortest among all three, and it got its name from the geographical locations at its ends. The southern end was located next to the Tangsui River in the present day Oceanic County of Hanzhong, and the northern end was located in the Luo Mountain to the west of present day Zhouzhi County. Hence, the southern half was called Tang Valley and the northern half was called Luo Valley. Cao Shuang had committed a grave strategic blunder when he selected this central route to attack Shu Han because despite being the shortest, the road condition was the poorest among all three routes. More importantly, among the three traditional passages, Tangluo Trail had the longest section without any water source. As a result, the logistic problem crippled the invasion force, with many if not most of the packing animals of Cao Wei force died of thirst before even get out of the valley. Cao Shuang was forced to mobilize tens of thousands of draftees as coolies to carry supplies, and many of them met the same fate of the packing animals. Consequently, morale plummeted and resentment of Cao Shuang’s rule not only drastically increased among the troops he commanded, but also back home in Cao Wei.
Order of battle
Cao Wei order of battle:
*Senior General Cao Shuang – Commander-in-chief
**General Subduing the West Xiahou Xuan – Deputy commander-in-chief
**Inspector of Yong State Guo Huai – Vanguard
Shu Han order of battle:
*Senior General Stabilizing the North
**General Protecting the Army
*Senior General Fei Yi
In March, 244, Cao Shuang promoted Xiahou Xuan as the General Subduing the West , taking command of more than seventy thousand troops, and inspector of Yong province Guo Huai was named as the vanguard of the invasion force. Cao Shuang led another force totaled more than seventy thousands subsequently joined Xiahou Xuan and Guo Huai’s force, and begun the march toward Hanzhong via Tangluo Trail. Cao Shuang’s protégés Deng Yang and Li Sheng participated in the invasion as his staff. The primary target of the Cao Wei invasion force was the Yangping Pass, located to the west of the present day Wuhou Town of Mian County of Shaanxi.
Senior General Stabilizing the North was in charge of defending Hanzhong for Shu Han, but his force totalled less than thirty thousand. Facing absolute numerical inferiority, some Shu Han commanders suggested to concentrate on defending Han City and Yue City (. Wang Ping rejected the idea because the reinforcements was too far away and it would take time to arrive, and it would cause disaster for Shu Han if the enemy was allowed to passed through Yangping Pass unopposed. Therefore, the enemy must be stopped by taking geographical advantage of local rugged terrain. General Protecting the Army Liu Min was ordered to take up positions in Xingshi Mountain, and to plant an array of flags over a hundred mile to fool the enemy into believing that the opposing Shu Han force was much greater than it actually was. Wang Ping himself would personally lead an army behind to prevent possible separate assaults by Cao Wei force from Gold Valley , located to the east of Xingshi Mountain. As Wang Ping had correctly predicted, by April, 244, the enemy advance was successfully checked at the Xingshi Mountain and the enemy’s supply begun to run out as their supply line was over extended and nearly all of their pack animals were dead. Senior General Fei Yi of Shu Han, meanwhile, was on his way to Hanzhong with reinforcements from Chengdu. The counteroffensive of Shu Han was about to be launched against the overstretched Cao Wei invasion force.
Cao Shuang’s staff officer Yang Wei realized the danger and begged Cao Shuang to abandon the campaign and retreat immediately, but Deng Yang objected and argued with Yang Wei despite his lack of any military knowledge. Yang Wei could not convince either and furiously claimed that Deng Yang and Li Sheng were playing lives of hundred thousands, as well as the fate of Cao Wei, and they should be decapitated. Cao Shuang was obviously very unhappy with such suggestions and turned down both. The Grand Tutor Sima Yi, who opposed the campaign from the very beginning, could no longer ignore the dangerous situation and wrote to Xiahou Xuan to inform him about the impending disaster, and warned him that Xiahou Xuan himself was well aware that years ago, Cao Cao almost suffered a total defeat in the struggle against Liu Bei for Hanzhong. Shu Han force was in firm control of Xingshi Mountain, which prevented Cao Wei force from continuing pushing forward, and if another Shu Han force cut off the retreating route of Cao Wei force, they would not even be able to live to regret it. Xiahou Xuan finally realized the dangerous situation they were in after getting Sima Yi’s letter, and finally managed to convince Cao Shuang to give the order to retreat, albeit the latter did so reluctantly.
Fei Yi, however, would not let the Cao Shuang retreat easily, and led his force around the Cao Wei force and blocked their retreat. Shu Han force setup defensive positions in the places where they enjoyed absolute geographical advantage over Cao Wei forces: the three ridges in the Luo Valley: Shen Ridge , Ya Ridge , and Watershed Ridge . Cao Shuang and his officers were barely able to escape back to Guanzhong after their forces suffered a devastating casualties that exceeded over a hundred thousand, though many had died before the retreat had even begun due to thirst, hunger and illness. Rumor has it that ever since the battle, even the people of the Republic of China era would see ancient soldiers in bloody uniforms in the Luo Valley in the windy dark nights, because the roaming ghosts of the soldiers killed seventeen centuries ago was still attempting to return home. For his victory, Fei Yi was awarded the rank of Chengxiang Marquis , and stayed in Hanzhong until September 244 when he returned to Chengdu. In contrast, the prestige and popularity of Cao Shuang dropped sharply, which helped to lead his eventual downfall in the power struggle against Sima Yi.
The Battle of Xingshi was one of the most important yet most understated battles in the Three Kingdoms era. The lack of participation of the principle figures of the time such as Zhuge Liang and Jiang Wei caused many authors to put much less emphasis or even ignore the battle in their works in comparison to other battles occurred in the Three Kingdoms era. In reality, the battle had profound impact in the history in that it postponed the unification of China for decades due to the heavy loss Cao Wei had suffered: because soldiers drafted from the peasantry, the heavy loss meant that no labors were available to tend the farmland. In order to tend farmlands and help the widows and orphans resulted from the defeated campaign, at least a hundred thousand soldiers from the Tuntian army was reassigned back to their agricultural roles. These troops never returned to the active service again as they were needed to remain as farmers and as a consequence, the total number of Cao Wei troops decreased by a quarter, dropping from eight hundred thousands at its peak to six hundred thousands, a number that was not exceeded until the time of the War of the Eight Princes, over half a century later.
The drastic loss of troops also caused to another important severe consequence in that Cao Wei was no longer able to suppress the rebellions of minorities in the north like it used to . From that point on, the smaller rebellions of minorities in the north would cumulated into a formidable force that eventually overthrown the Chinese rule in the northern China seven decades later during the Jin Dynasty . Despite being relatively unnoticed in literature, Chinese historical military strategists highly credited the battle, for example, Liu Ji in his work titled “The Unexpected Strategies of a Hundred Battles” 《百战奇略》 classified this battle as the classical example of “retreating wars” , meaning that if your enemy held the absolute geographical advantage and you were already having trouble to carry on the fight, a rapid retreat was the only viable option.