Following the raid of old Panama in 1671 by the pirate Henry Morgan, Casco Viejo was built on a rocky peninsula accessible by ship only during high tide for defensive purposes. Once the entire city of Panama with over 30,000 residents, the city exploded in 1904 with the construction of the Panama Canal and is now just a district of greater Panama City.