After losing the battle, Liu Bei fell gravely ill at Baidi City. Despite taking many medicines, his condition did not improve. Knowing his days were numbered, he sent for Zhuge Liang from Chengdu. When he saw Zhuge Liang, Liu Bei couldn't hold back his tears and said sorrowfully, "I deeply regret not heeding your advice, Prime Minister. Now, having lost the battle, the foundation of Shu is nearly destroyed by my hands, and I am afflicted with a severe illness, soon to leave this world. What worries me most is my son, Liu Shan. He is still young and cannot shoulder the heavy responsibilities of the state. I must trouble you to support him more." Hearing this, Zhuge Liang was also deeply grieved. Liu Bei continued, "If Liu Shan is a worthy talent, please assist him as Prime Minister. If he proves unworthy, you may take his place."
After saying these words, Liu Bei breathed his last and passed away. Suppressing his grief, Zhuge Liang returned to Chengdu, announced Liu Bei's death, and then assisted Liu Shan in ascending the throne, who was historically known as the Later Ruler of Shu Han.
In 223 AD, a wealthy local gentry named Yong Kai in Yizhou Commandery, seeing that Liu Bei had died and believing the Shu Han regime would eventually fall, killed the governor of Yizhou, Zheng Ang, and captured Zhang Yi, the court-appointed successor governor, sending him to Eastern Wu. He then urged the ethnic minorities of the four southern commanderies to rise up against Shu Han, but these minorities, distrusting Yong Kai, refused to support him. Nevertheless, Yong Kai's rebellion had already created a severe crisis for Shu Han.
On this day, a subordinate reported to Zhuge Liang that Meng Huo was deliberately speaking ill of the Shu Han regime in front of the ethnic minorities, stirring up discontent and resentment, which led all the ethnic minorities in the Nanzhong region to join Yong Kai's rebellion. Because Meng Huo was particularly influential in Nanzhong and highly respected by everyone, his words were deeply trusted by all.
After hearing the news, Zhuge Liang did not rush to dispatch troops. Instead, he sent several letters to Yong Kai, urging him not to oppose the Shu Han regime. He also dispatched Deng Zhi and Chen Zhen to the Eastern Wu kingdom to mend relations, and instructed Governor Gong Lu to prepare for battle along the southern border. Zhuge Liang believed that since the state had just lost its ruler, the top priority was to stabilize public sentiment and ensure national security. Therefore, he decided to personally lead an expedition to suppress the rebellion.
Before the expedition, Military Advisor Ma Su, while bidding farewell to Zhuge Liang, suggested using psychological tactics in this campaign, namely "winning hearts is the best strategy, capturing cities is secondary; psychological warfare is paramount, armed conflict is inferior." Ma Su analyzed that dealing with these ethnic minorities required finesse, not brute force, and true victory could only be achieved by earning their genuine submission. Zhuge Liang approved of Ma Su's advice. He first divided his army into three routes, leading one group himself by water to Yuexi Commandery (present-day southeast of Xichang, Sichuan), while ordering his subordinates Ma Zhong and Li Hui to lead the other two groups to attack Zangke Commandery (around present-day Zunyi, Guizhou) and Yizhou Commandery respectively. The leaders of Zangke and Yuexi commanderies had already joined Yong Kai's rebellion, and they engaged in fierce battles with the Shu army. During the conflict, Gao Ding, the leader of Yuexi Commandery, had a dispute with Yong Kai over command authority, ultimately resulting in Gao Ding killing Yong Kai. To demonstrate loyalty to Meng Huo, Gao Ding handed over all of Yong Kai's troops to Meng Huo's command.
Li Hui's army advanced all the way to Kunming, wiping out the rebel forces entrenched in Yizhou Commandery, while Ma Zhong also achieved a great victory and later joined forces with Li Hui. Zhuge Liang, leading the main army, won repeated battles in Nanzhong and even killed Gao Ding. Ma Zhong and Li Hui then marched to Nan Commandery to support Zhuge Liang, and the three armies merged into one, launching a fierce assault on Meng Huo's forces.
Zhuge Liang recalled Ma Su's advice before the expedition, so he first sent people to investigate Meng Huo's situation, learning that Meng Huo was very popular among the local people, which made a direct attack even more unfeasible as it could provoke stronger opposition from the populace, so Zhuge Liang decided to first make Meng Huo submit to Shu Han and then use his prestige to pacify the Southern region.
Zhuge Liang initiated the battle, but he ordered his soldiers to put up only a token resistance before retreating. When Meng Huo saw the Shu army fleeing, he assumed they were no match for him and became smug, commanding his forces to pursue them relentlessly. However, he did not realize that Zhuge Liang had already set a trap waiting for him. After being captured, Meng Huo appeared before Zhuge Liang with a disdainful expression, expecting to be executed. To his surprise, Zhuge Liang ordered his bonds to be loosened and gently advised him not to oppose the Shu Han regime anymore. Meng Huo refused to listen and kept shouting insults, but Zhuge Liang did not argue; instead, he smiled and led him on a tour of the Shu army camp. Beforehand, Zhuge Liang had deliberately hidden all the elite soldiers, making Meng Huo believe the camp only contained weak and elderly troops. After seeing this, Meng Huo said to Zhuge Liang, "Being captured this time was due to my tactical error. Now that I see your forces are nothing special, defeating you will be extremely easy." Meng Huo's words played right into Zhuge Liang's plan, so he ordered Meng Huo to be escorted out of the camp, allowing him to prepare properly and return for another round.
By midnight, Meng Huo led five hundred soldiers to launch a surprise attack on the Shu army. Along the way, there were no ambushes, and they entered the camp smoothly. Just as Meng Huo was secretly pleased with his successful raid, Shu troops suddenly emerged from all sides, surrounding Meng Huo and his men. It turned out that Zhuge Liang had long anticipated Meng Huo's midnight attack and had set up an ambush waiting for him. Meng Huo was captured again, but he remained unconvinced. Zhuge Liang, being magnanimous, let him go once more, waiting for his next assault.
For the second time, Meng Huo opted for a water battle, stationing his troops on the southern bank of the Lu River and quietly waiting for an opportunity to attack. Zhuge Liang deliberately pretended to fall for the ruse, ordering some soldiers to build rafts and cross the river. When the rafts reached the middle of the river, Meng Huo ordered his men to shoot arrows at the Shu army. The Shu army quickly turned back, but soon ventured into the river again, only to be met with another volley of arrows from Meng Huo's forces, prompting another retreat. This back-and-forth repeated many times, with the Shu army never reaching the opposite bank, while Meng Huo merely ordered arrow fire without any other movement. During this standoff with Meng Huo, Zhuge Liang had secretly dispatched two large forces, which crossed the river upstream and downstream respectively, unexpectedly surrounding Meng Huo's army, and Meng Huo was captured once again.
After this happened several times, Meng Huo no longer dared to underestimate Zhuge Liang. He gathered several tribal chiefs and led a joint army to attack the Shu forces. Zhuge Liang easily lured them into a pre-set ambush. The tribal chiefs were extremely panicked and begged Meng Huo to find a way to escape. Just then, Zhuge Liang sent word ordering the Shu army to let Meng Huo and his men go. The tribal chiefs had not expected Zhuge Liang to say this and felt very uneasy. But Meng Huo, with tears streaming down his face, said, "The Prime Minister has treated us with the utmost kindness. If we still refuse to see the truth, we truly deserve to die." With that, he led the chiefs in surrendering to Zhuge Liang.
Zhuge Liang pacified Nanzhong with little effort, won the people's hearts, and after that, Nanzhong saw virtually no riots or rebellions.