The dynasty of the Malaccan descendants lasted until the death of Mahmud II, when it was succeeded by the Bendahara Dynasty, a dynasty of ministers who had previously served in the Malacca Sultanate. The Dutch felt increasingly threatened in the 18th century, especially when the English East India Company started to establish a presence in the northern Malay Peninsula, leading the Dutch to seize the Bugis areas of Riau and expel the Bugis from both Riau and Selangor so these areas would not fall under British rule. This ended Bugis political domination in the Johor-Pahang-Riau empire, resulting in the Bugis being banned from Riau in 1784. During the rivalry between the Bugis and Dutch, Mahmud Shah III concluded a treaty of protection with the VOC on board the HNLMS "Utrecht" and the sultan was allowed to reside in Riau with Dutch protection. Since then, mistrust between the Bugis and Malay escalated. From 1796 to 1801 and from 1807 to 1818, Malacca was placed under British Residency as the Netherlands were conquered by France in the Napoleonic Wars, but it was returned to the Dutch in 1818. Malacca served as the staging area for the British victory in 1811.