Due to the proximity of the city to the sea (about 4 kilometers away) and the danger of attack by pirates and privateers, the Wall of Trujillo was built for defense during the reign of Viceroy Melchor de Navarra and Rocafull and the city mayors Bartolome Martinez and Fernando Ramirez Jarabeitia Orellana.