During the American War of Independence in the late 18th century, the islands became a target for US naval forces. Under the command of Commodore Esek Hopkins, US Marines, the US Navy occupied Nassau in 1776, before being evacuated a few days later. In 1782 a Spanish fleet appeared off the coast of Nassau, and the city surrendered without a fight. Later, in April 1783, on a visit made by Prince William of the United Kingdom (later to become King William IV) to Luis de Unzaga at his residence in the Captaincy General of Havana, they made prisoner exchange agreements and also dealt with the preliminaries of the Treaty of Paris (1783), in which the recently conquered Bahamas would be exchanged for East Florida, which would still have to conquer the city of St. Augustine, Florida in 1784 by order of Luis de Unzaga; after that, also in 1784, the Bahamas would be declared a British colony.