Sima Zhao, having long heard that Deng Ai was stubborn and self-opinionated and also of high merit and great power, grew suspicious and sent Wei Guan and others with troops to arrest Deng Ai. Zhong Hui, upon receiving the order, immediately dispatched troops. Deng Ai and his son, caught off guard, were all captured by Zhong Hui and imprisoned. Zhong Hui took the opportunity to merge Deng Ai's forces, gaining full military control of Cao Wei's troops in Shu. Jiang Wei, seeing his plan succeed, rejoiced secretly and further urged Zhong Hui to revolt against the Sima clan and seize the realm. Jiang Wei secretly said to Zhong Hui: 'Now that you hold a strong army and have all the advantages of Shu, this is a heaven-sent opportunity. If you do not act now, it will be too late.'
Zhong Hui, elated and overconfident, heeded Jiang Wei's words, summoned all the Wei generals in Shu, and issued a manifesto denouncing Sima Zhao, listing his crimes. Zhong Hui planned to bury all the Wei generals alive to eliminate future trouble, then divide his forces with Jiang Wei to carry out their grand scheme. Jiang Wei secretly wrote a letter to Liu Shan, saying: 'I hope Your Majesty can endure a few more days of humiliation. Your servant will restore the Han dynasty for Your Majesty, kill all the Wei traitors, and repay Your Majesty.' He intended to take advantage of Zhong Hui's rebellion to kill Zhong Hui and restore Shu Han.
Unexpectedly, the plan was leaked. Zhong Hui's trusted general, Hu Lie, who had long known of Zhong Hui's intent to kill the other generals, secretly told his son. The news that Zhong Hui planned to bury the generals alive spread like wildfire, and the Wei generals rose in anger and resistance. A mutiny broke out in the army, and rebel soldiers rose everywhere. Zhong Hui hastily fought back, but the situation became critical. Jiang Wei led the remnants of Shu Han to resist the mutinous troops alongside Zhong Hui, but they could not hold out. The mutineers rushed into the government house and surrounded Zhong Hui tightly.
Jiang Wei knew that restoring the kingdom was hopeless. Looking up to heaven, he sighed: 'My plans have failed—this is fate!' Then he drew his sword and committed suicide, dying after receiving several wounds, at the age of sixty-two. Many of the Shu Han officers and soldiers also died in the chaos. Zhong Hui was also killed by the mutineers. Deng Ai and his son Deng Zhong, though rescued, were pursued and killed on the way back by soldiers sent by Wei Guan. Thus, Shu Han was completely destroyed. Of the three kingdoms, Wei had gained two, leaving only Eastern Wu.