Strategic planning and opening moves In the autumn of 263, the Wei imperial government started mobilising troops in preparation for a campaign against Shu.
Sima Zhao, who oversaw the campaign, ordered Deng Ai to lead 30,000 troops to Tazhong (沓中; northwest of present-day
Zhugqu County,
Gansu) to harass Jiang Wei and keep him occupied, while
Zhuge Xu, the Inspector of
Yong Province, would lead forces to block Jiang Wei's retreat route back to Shu. Before Deng Ai embarked on the campaign against Shu, he dreamt of himself sitting on a mountaintop with water flowing near him. He asked an official, Yuan Shao (), who was well-versed in the
Yijing, to explain to him what his dream meant. Yuan Shao told him that he would successfully conquer Shu, but would not return to Wei. Deng Ai felt gloomy after hearing this. Deng Ai sent
Wang Qi () to lead troops attack Jiang Wei's camp directly, with
Qian Hong leading another force to clear the path, and Yang Xin () to attack the enemy positions at Gansong (甘松; around present-day
Songpan County,
Sichuan). When Jiang Wei received news that another Wei army led by
Zhong Hui had occupied
Hanzhong Commandery, he led his troops from Tazhong back further into Shu territory, but was pursued by Yang Xin to Qiangchuankou (彊川口; the intersection of the
Bailong and
Jialing rivers), where he was defeated. Jiang Wei learnt that Zhuge Xu had blocked his retreat route at the bridge of Yinping, so he led his men through Konghan Valley (孔函谷; south of present-day
Xigu District,
Lanzhou, Gansu) to the northern road in an attempt to bypass Zhuge Xu's position. When Zhuge Xu heard about it, he retreated back by 30
li. By then, Jiang Wei and his troops had travelled about 30
li on the northern road when they heard that Zhuge Xu had lifted the blockade at the bridge. Jiang Wei ordered his troops to quickly turn back and cross the bridge. Zhuge Xu tried to turn back to block Jiang Wei again but arrived at the bridge one day too late. After crossing the bridge, Jiang Wei moved to the mountain pass of
Jiange and garrisoned there. Zhong Hui attacked Jiang Wei at Jiange several times but was unable to breach the defences.
Capture of the Shu capital Deng Ai proposed:
Zhong Hui approved Deng Ai's idea and even ordered his subordinate Tian Zhang () to join Deng Ai on the expedition. Some time between 18 November and 17 December 263, Deng Ai led a strike force from Yinping through the shortcut, bypassing the west of Jiange and heading straight towards
Jiangyou. The shortcut covered a distance of more than 700
li and cut across mountainous terrain. Deng Ai and his men had to construct several bridges along the way. The mountains were high and the valleys were deep, which made the journey extremely dangerous. After some time, they were completely cut off from their supply train. Deng Ai wrapped himself in a large piece of
felt and rolled down the mountain. His men climbed trees and scaled cliffs in single file. Along the way, they encountered three groups of Shu ambushers, defeated them and destroyed their camps. Deng Ai let Tian Zhang lead the vanguard and clear the path. Deng Ai and his vanguard showed up at
Jiangyou. Ma Miao (), the Shu-appointed administrator of Jiangyou, gave up resistance and surrendered to Deng Ai. The Shu general
Zhuge Zhan led an army from Fu County to
Mianzhu, where they engaged Deng Ai and his troops in battle. Deng Ai ordered his son Deng Zhong () to flank the enemy from the right, and Shi Zuan () to flank the enemy from the left. Both Deng Zhong and Shi Zuan were driven back by Zhuge Zhan, and they told Deng Ai: "The enemy cannot be defeated.". Deng Ai sternly replied: "This battle will determine whether we live or die. What do you mean when you say the enemy cannot be defeated?" He wanted to execute them, but they turned back and hastily readied their troops for battle again. They defeated the Shu forces and killed the enemy officers Zhuge Zhan,
Zhuge Shang and
Zhang Zun. Deng Ai and his men then pressed on further to Luo County (雒縣; north of present-day
Guanghan, Sichuan).
Liu Shan, the Shu emperor, sent an emissary to present his imperial seal to Deng Ai and indicate his wish to surrender.
Managing post-war Shu When Deng Ai arrived in Chengdu, Liu Shan tied himself up and led an entourage of over 60 people to officially surrender. Deng Ai freed Liu Shan from his bonds and treated him kindly. He also forbid his soldiers from plundering and pillaging the city, and ordered that daily activities in the city resume as per normal. Many former Shu officials were so impressed with Deng Ai that they willingly submitted to him; the people of Shu also praised Deng Ai for his kindness. Deng Ai used his acting imperial authority granted by the Wei government to appoint Liu Shan as acting General of Chariots of Cavalry () and grant titles to many former Shu nobles and officials; some of them became his subordinates. Deng Ai also appointed Shi Zuan as the Inspector of
Yi Province and put
Qian Hong in charge of overseeing the former Shu commanderies. A memorial was constructed at Mianzhu to glorify Deng Ai's victory over Zhuge Zhan, and the fallen Wei soldiers were buried alongside their Shu counterparts. Deng Ai became arrogant about his achievements in conquering Shu. He once bragged to the former Shu officials: "All of you are lucky to have encountered me, which is why you are where you are today. If you encountered someone like
Wu Han, you would have been destroyed." He also said: "Jiang Wei is a short-lived hero. He pales in comparison with me." Some people scorned him for his boastfulness. On 8 February 264, the Wei imperial court issued an edict praising Deng Ai for his successful conquest of Shu and comparing him to famous generals such as
Bai Qi,
Han Xin,
Wu Han and
Zhou Yafu. Deng Ai was promoted to the position of Grand Commandant () in the imperial court and had the number of taxable households in his marquisate increased by 20,000. His two sons were made village marquises () and given 1,000 taxable households each in their marquisates. == Downfall and death ==