After his defeat in 1828, he was given the choice of either surrendering or to be executed, he was garroted publicly and later succeeded by Sultan Omar Ali Saifuddin II. Despite that according to a number of accounts, Raja Api passed away in or around 1824, which the subsequent changes to Brunei's policies appear to support. Whatever the reason, Raja Api was unpopular and had a reputation for harshness. He was strangled to death on Pulau Chermin by his sister Raja Nur Alam and those who backed her son's legal claims. Pengiran Muda Hashim and Pengiran Muda Mohamed, as well as his siblings and other relatives, scattered, with some migrating to Sarawak.
