In August 1845, Admiral Thomas Cochrane arrived at Brunei with a squadron of from six to eight ships to release two Lascar seamen who were believed to be hidden there. Badruddin accused Yusof of being involved in the slave trade due to his close relations with a notable pirate leader Sharif Usman in Marudu Bay and the Sultanate of Sulu. Denying the allegation, Yusof refused to attend a meeting with Cochrane, and escaped after being threatened with force by Cochrane before regaining his own force in the Brunei capital. Cochrane then sailed away to Marudu Bay in pursuit of Usman, while Yusof was defeated by Badruddin. Hashim managed to establish a rightful position in Brunei Town to become the next Sultan after successfully defeating the piratical forces led by Yusof who fled to Kimanis in northern Borneo where he was executed. Yusof was the favourite noble to the Sultan and with Hashim's victory, this upset the chances of the son of Sultan Omar Ali Saifuddin II to become the next leader. Mahkota, who had returned to Brunei in 1845 after his capture in Sarawak in 1844 became the Sultan's adviser in the absence of Yusof who had been executed. He prevailed on the Sultan to order the execution of Hashim, whose presence had become unwelcome to the royal family, especially due to his close ties with Brooke that were favourable to English policy. Beside that, an adventurer named Haji Saman, who was connected to the late Yusof, played upon the Sultan's fear of Hashim taking over his throne.