Dost Mohammad remained a British prisoner till the end of 1841 when he was set free by the British authorities who, after they took their revenge on Kabul, had resolved to abandon any attempts to intervene in the internal affairs of Afghanistan. After Shuja Shah was assassinated in April 1842, Dost Mohammad quickly reestablished his authority. He died on 9 June 1863 of natural causes, one of the few Afghan rulers in the past thousand years to do so.