Spain was then prosecuting a war against the independence of the Dutch, the Dutch East and West India companies tried to conquer Brazil from them. Salvador played a strategically vital role against Dutch Brazil, but was captured and sacked by a West India Company fleet under Jacob Willekens and Piet Hein on 10 May 1624. Johan van Dorth administered the colony before his assassination, freeing its slaves. The city was recaptured by a Luso-Spanish fleet under Fadrique Álvarez de Toledo y Mendoza on 1 May 1625. John Maurice, Prince of Nassau-Siegen, tried to conquer the city for his country, unsuccessfully besieging it between April and May 1638. In 1763, the colonial administration was removed to Rio de Janeiro and elevated to a viceroyalty. Salvador remained the heart of the , Bahia's rich agricultural maritime district, but was largely outside Brazil's early modernization. The area formed a center of royal Portuguese support against heir apparent 's declaration of independence from European Portugal on 7 September 1822. Its elites initially remained loyal to the Portuguese crown while rebels from Cachoeira besieged them for a year until finally receiving Portugal's surrender of the town on 2 July 1823, which is now celebrated as Bahia Independence Day. The local elite was similarly hesitant during Manuel Deodoro da Fonseca's later coup that established the republic in 1889. Owing to whales' use of the Bay of All Saints as a mating ground, Salvador became a large whaling port in the Southern Hemisphere during the 19th century but the trade had already begun to fall off by the 1870s. Under the empire and republic periods, however, the town slowly began to industrialize. In 1873, Brazil's first elevator, the powerful hydraulic , was constructed to connect the city's upper and lower towns. Having undergone several upgrades, it continues in use. By the First World War, it was joined by a second elevator and Salvador was connected to four railroads: the Bahia & Alagoinhas to Joazeiro, the Bahia Central, the Nazareth Tramway, and a short line to Santo Amaro. Its central districts and the major suburbs of Bomfim and Victoria were served by four streetcar lines, which had begun to electrify. It also served as a port of call for most steamship lines trading between Europe and South America. In 1985, UNESCO listed the city's Pelourinho neighborhood as a World Heritage Site. In the 1990s, a major municipal project