Rivalry between the British and the Dutch now came into play. The British had earlier gained Malacca from the Dutch under the Treaty of The Hague in 1795 and saw an opportunity to increase their regional influence. They crowned Tengku Hussein in Singapore, and he took the title Hussein Shah of Johor. The British were actively involved in the Johor-Riau administration between 1812 and 1818, and their intervention further strengthened their dominance in the Strait of Malacca. The British recognised Johor-Riau as a sovereign state and offered to pay Engku Puteri 50,000 Ringgits (Spanish Coins) for the royal regalia, which she refused. Seeing the diplomatic advantage gained in the region by the British, the Dutch responded by crowning Tengku Abdul Rahman as sultan instead. They also obtained, at the Congress of Vienna, a withdrawal of British recognition of Johor-Riau sovereignty. To further curtail the British domination over the region, the Dutch entered into an agreement with the Johor-Riau Sultanate on 27 November 1818. The agreement stipulated that the Dutch were to be the paramount leaders of the Johor-Riau Sultanate and that only Dutch people could engage in trade with the kingdom. A Dutch garrison was then stationed in Riau. The Dutch also secured an agreement that Dutch consent was required for all future appointments of Johor-Riau Sultans. This agreement was signed by Yang Dipertuan Muda Raja Jaafar representing Abdul Rahman, without the sultan's consent or knowledge.