 In 1861 the first tram company was formed, mostly using horses or mules to draw them, and fully established over the next few years.Taking advantage of the total lack of defenses, a Spanish fleet commanded by Casto Méndez Núñez bombarded the city during the Chincha Islands War in 1866.Chilean merchant ships were sunk, except for those vessels whose captains hoisted foreign flags.