Dutch Malacca was the longest period that Malacca was under foreign control. The Dutch ruled for almost 183 years with intermittent British occupation during the Napoleonic Wars. This era saw relative peace with little serious interruption from the Malay sultanates due to the understanding earlier on forged between the Dutch and the Sultanate of Johor in 1606. This time also marked the decline of the importance of Malacca. The Dutch preferred Batavia as their economic and administrative centre in the region and their hold in Malacca was to prevent the loss of the city to other European powers and subsequently the competition that would naturally come with it. Thus in the 17th century, with Malacca ceased to be an important port, the Johor Sultanate became the dominant local power in the region, due to the opening of its ports and the alliance with the Dutch.