The Spaniards attacked Sulu, captured the capital, and carried off the Sultan to Manila. When the English took Manila, under Sir William Draper in 1762, they released the Sultan Mumin, and he ceded the territory that had been granted to his predecessors by the Sultan of Bruni in or about 1674 to the East India Company, by deed signed in 1763, in consideration of an engagement entered into by the Company to protect him from the Spaniards.

Sultan Jemal ul Alam, of Bruni, who died in 1796, married Rajah Nur Alam, daughter of his uncle Sultan Khan Zul Alam, 21st Sultan of Bruni, by his first wife. By her he had one legitimate son, Omar Ali Saif Udin. The wife of Sultan Jemal had a full brother, Sri Banun Muda (usually called Rajah Api), and also half-brothers Hasim and Muhammad, sons of Khan Zul Alam by his second wife, and Bedrudin and two other sons by his third wife, a Lanun lady of rank.

A History of Sarawak under Its Two White Rajahs 1839-1908 — Part 50

On the death of his grand-uncle, also grandfather, and predecessor, Khan Zul Alam, Omar Ali was but a child, and Rajah Api claimed the throne, under the title of Sultan Muhammad Alam, and there were years of trouble in Bruni. Sir Hugh Low describes him as a madman with the most cruel propensities, whence probably his nickname Api, which signifies "Fire." He treated his nephew with great roughness, and often threatened him with a drawn sword, and Omar ran whimpering to his mother to complain. The prince's mother had long been jealous of the assumption of the sultanate by her brother, and, her son being almost imbecile, she hoped, by getting rid of Api, to exercise great power in the state. Accordingly, about the year 1828, she summoned those of her party and surrounded the residence of the Sultan Muhammad Alam, or Api, who finding himself deserted escaped in a boat. His sister sent after him a pangiran, or noble, with professions of friendship, and this pangiran persuaded him to assume the disguise of a woman to facilitate his escape. Then he got him into a little skiff, and led him into an ambush, where he was ordered to be put to death. He received the intimation with firmness. "Observe," said he, "when you strangle me, on which side my body shall fall—if to the right it prognosticates good for Bruni, if to the left it foretells evil." The bow-string was twisted, and Api sank on his left side. As we shall see that omen proved true.

A History of Sarawak under Its Two White Rajahs 1839-1908 — Part 50