In Shu, the strategic thinking behind the Northern Expeditions came from Zhuge Liang's Longzhong Plan, which he presented to the warlord Liu Bei in 207.
In 227, Zhuge Liang ordered troops from throughout Shu to mobilise and assemble in Hanzhong Commandery in preparation for a large-scale military campaign against Wei.
Among other things, the memorial contained Zhuge Liang's reasons for the campaign against Wei and his personal advice to Liu Shan on governance issues.
[2] After Liu Shan approved, Zhuge Liang ordered the Shu forces to garrison at Mianyang (沔陽; present-day Mian County, Shaanxi).
It was the major administrative centre of the mountainous frontier district between the rich Sichuan Basin in the south and the Wei River valley in the north.
Following the Jialing Valley, the route emerges in the north where the Wei River widens considerably near Chencang (in present-day Baoji, Shaanxi).
A few more minor and difficult routes lay to the east, notably the Ziwu Valley, which leads directly to the south of Chang'an.
[13] In the spring of 228, Zhuge Liang launched the first Northern Expedition and led the Shu forces to Mount Qi (祁山; the mountainous regions around present-day Li County, Gansu).
[16] In response to the Shu invasion, Cao Rui moved from Luoyang to Chang'an to oversee the defences and provide backup.
In the meantime, Zhuge Liang sent Ma Su to lead the vanguard force to engage Zhang He at Jieting (街亭; located east of present-day Qin'an County, Gansu).
Ma Su not only disobeyed Zhuge Liang's orders, but also made the wrong moves, resulting in the Shu vanguard suffering a disastrous defeat.
[22] In the winter of 228–229, Zhuge Liang launched the second Northern Expedition and led Shu forces to attack the Wei fortress at Chencang via San Pass.
[26] Upon learning that Wei reinforcements were approaching Chencang, Zhuge Liang immediately pulled back all his troops and returned to Hanzhong.
[29][30] When Zhuge Liang returned from the campaign, the Shu emperor Liu Shan issued an imperial decree to congratulate him on his successes in defeating Wang Shuang during the second Northern Expedition, forcing Guo Huai to flee, winning back the trust of the local tribes and capturing Wudu and Yinping commanderies during the third Northern Expedition.
At the same time, another Wei army led by Sima Yi, acting on Cao Rui's order, advanced towards Shu from Jing Province by sailing along the Han River.
The rendezvous point for Cao Zhen and Sima Yi's armies was at Nanzheng County (南鄭縣; in present-day Hanzhong, Shaanxi).
[33] As Xiahou Ba led the vanguard of this expedition through the 330 km Ziwu Trail (子午道), he was identified by the local residents who reported his presence to the Shu forces.
[39] At Mount Qi, Zhuge Liang managed to convince Kebineng, a Xianbei tribal leader, to support Shu in the war against Wei.
[43] Zhuge Liang encountered Sima Yi at Hanyang (漢陽) to the east of Shanggui County, but they did not engage in battle: Zhuge Liang ordered his troops to make use of the terrain and get into defensive positions; Sima Yi ordered his troops to get into formation, while sending Niu Jin to lead a lightly armed cavalry detachment to Mount Qi.
Li Yan, the Shu general responsible for overseeing the transportation of food supplies to the frontline, falsely claimed that the emperor Liu Shan had ordered a withdrawal.
[52] In any case, according to Records of the Three Kingdoms and Zizhi Tongjian, Zhuge Liang retreated to the Shu, because of lack of supply, not defeat.
The Weilüe mentioned that Zhang He refused to obey Sima Yi's order and argued that, according to classical military doctrine, one should refrain from pursuing an enemy force retreating to its home territory.
Indeed, Zhang He fell into an ambush at Mumen Trail (木門道; near present-day Qinzhou District, Tianshui, Gansu), where Zhuge Liang had ordered crossbowmen to hide on high ground and fire at approaching enemy forces when they entered a narrow defile.
[55] In the spring of 234, Zhuge Liang led more than 100,000 Shu troops out of Xie Valley (斜谷) and camped at the Wuzhang Plains on the south bank of the Wei River near Mei County.
Aside from using the flowing horse to transport food supplies to the frontline, he implemented a tuntian plan by ordering his troops to grow crops alongside civilians at the south bank of the Wei River.
[56][57] In response to the Shu invasion, the Wei general Sima Yi led his forces and another 20,000 reinforcements to the Wuzhang Plains to engage the enemy.
Cao Rui even sent Xin Pi as his special representative to the frontline to ensure that Sima Yi followed orders and remained in camp.
The messenger said that Zhuge Liang consumed three to four sheng of grain a day and that he micromanaged almost everything, except trivial issues like punishments for minor offences.
"[66] Based on his observations that the Shu army made a hasty retreat, he concluded that Zhuge Liang had indeed died and so he led his troops in pursuit again.
Some people in Eastern Wu suspected that Shu Han wanted to renege on the Shu-Wu alliance, but Sun Quan commented that it was simply a sign of fatigue and exhaustion.