Later in 1640, the Portuguese were defeated and the fort was demolished by a Dutch army led by Admiral Jacobs Koster, who received support from the Sinhalese king to rebuild the fort according to Dutch standards. After the initial build-up of the 36-hectare Dutch fort in the 17th century, they continued to fortify and strengthen the fort and maintained it as their main base within the country. During the era of Dutch ruling, they built a Protestant church, Commander's residence, a gun house, and various other structures within the walls of the fort. This remained the main port of Sri Lanka for over 200 years until the British took over the island from the Dutch.