important port, Johor became the dominant regional power. The policy of the Dutch in Malacca drove traders to Riau, a port controlled by Johor. The trade there far surpassed that of Malacca. The VOC was unhappy with that but continued to maintain the alliance because the stability of Johor was important to trade in the region. The Sultan provided all the facility required by the traders. Under the patronage of the Johor elites, traders were protected and prospered. With a wide range of goods available and favourable prices, Riau boomed. Ships from various places such as Cambodia, Siam, Vietnam and all over the Malay Archipelago came to trade. The Bugis ships made Riau the centre for spices. Items found in China or example, cloth and opium were traded with locally sourced ocean and forest products, tin, pepper and locally grown gambier. Duties were low, and cargoes could be discharged or stored easily. Traders found they do not need to extend credit, for the business was good. Like Malacca before it, Riau was also the centre of Islamic studies and teaching. Many orthodox scholars from the Muslim heartlands like the Indian Subcontinent and Arabia were housed in special religious hostels, while devotees of Sufism could seek initiation into one of the many Tariqah (Sufi Brotherhood) which flourished in Riau. In many ways, Riau managed to recapture some of the old Malacca glory. Both became prosperous due to trade but there was a major difference; Malacca was also great due to its territorial conquest. Bugis and Minangkabau influence The last sultan from the Malaccan dynasty, Sultan Mahmud Shah II, was a person of unstable disposition. When Bendahara Habib was the Bendahara, he effectively shielded the people from the Sultan 's idiosyncrasies. After the demise of Bendehara Habib, he was replaced by Bendahara Abdul Jalil. As the Bendahara was only a cousin, he could not rein in the Sultan 's eccentric behaviour. The Sultan ordered the pregnant wife of a noble, Orang Kaya Megat Sri Rama killed, as she had taken a slice of the royal jack fruit. Subsequently, the Sultan was killed by Megat Sri Rama in revenge. Sultan Mahmud Shah II of Johor had died in 1699 without an heir. The Orang Kayas, who were normally tasked with advising the Sultan, were in a fix. They went to Muar to meet Sa Akar DiRaja, Raja Temenggong of Muar, the Sultan's uncle