Realising he had no chance to win, Meng Huo pledged allegiance to Shu, and was appointed by Zhuge Liang as governor of the region to keep the populace content and secure the southern Shu border. This would ensure that the future Northern Expeditions would proceed without internal disruptions. Rich and abundant resources acquired from Nanzhong were used to fund Shu's military and the state became more prosperous. After pacifying the Nanman, Zhuge Liang ordered the Shu military to make preparations for a large scale offensive on Wei. In 227, while in Hanzhong, he wrote a memorial, titled "Chu Shi Biao", to Liu Shan, stating his rationale for the campaign and giving advice to the emperor on good governance. From 228 until his death in 234, Zhuge Liang launched a total of five Northern Expeditions against Wei, all except one of which failed. During the first Northern Expedition, Zhuge Liang persuaded Jiang Wei, a young Wei military officer, to surrender and defect to his side. Jiang Wei became a prominent general of Shu later and continued Zhuge Liang's legacy of an aggressive foreign policy against Wei. The other permanent gains by Shu were the conquests of the impoverished Wudu and Yinping commanderies, as well as the relocation of Wei citizens to Shu territories on occasion. In the spring of 231, Zhuge Liang finally met his nemesis, Sima Yi (the newly appointed Wei commander), at the Battle of Mount Qi, the deadliest campaign of the five expeditions in terms of death toll. In late 234, Zhuge Liang and Sima Yi reached a stalemate at the Battle of Wuzhang Plains. Straining his energy on military matters big and small, Zhuge Liang fell seriously ill and eventually died in camp at the age of 53. Before his death, Zhuge Liang recommended Jiang Wan and Fei Yi to succeed him as regent of Shu. He was buried on Mount Dingjun according to his dying wish and posthumously granted the title "Marquis Zhongwu" (忠武侯; literally "loyal and martial marquis") by Liu Shan. Zhuge Liang's ancestor, Zhuge Feng (), served as the Colonel-Director of Retainers during the reign of Emperor Yuan of the Han dynasty. Zhuge Liang's father, Zhuge Gui (), served as an assistant officer in Mount Tai Commandery in the late Han dynasty. Zhuge Liang's cousin-uncle, Zhuge Xuan, who raised Zhuge Liang and Zhuge Jun, served as the Administrator of Yuzhang Commandery before serving under Liu Biao, the Governor of Jing Province.