After Zhuge Liang's death, his position as chancellor fell to Jiang Wan, Fei Yi and Dong Yun, in that order. But after 258, Shu politics became increasingly controlled by the eunuch faction, led by Huang Hao, and corruption rose. Despite the energetic efforts of Jiang Wei, Zhuge Liang's protégé, Shu was unable to secure any decisive achievement. In 263, Wei launched a three-pronged attack and the Shu army was forced into general retreat from Hanzhong. Jiang Wei hurriedly held a position at Jiange but he was outflanked by the Wei commander Deng Ai, who force-marched his army from Yinping through territory formerly considered impassable. By the winter of the year, the capital Chengdu fell due to the strategic invasion of Wei by Deng Ai who invaded Chengdu personally. The emperor Liu Shan thus surrendered. The state of Shu had come to an end after 43 years. Liu Shan was reinstated to the Wei capital of Luoyang and was given the new title of the "Duke of Anle". Directly translated, it meant the "Duke of Safety and Happiness" and was a trivial position with no actual power.