Towards 1550, the Spanish built the Santa Barbara Fortress which was located on top of a hill from where they could see the whole bay and all possible attacks. But this could not protect the town itself which was located in the bay. In the following years, even though some troops were sent to defend the city, nothing could be done to prevent the attacks and the city was severely raided constantly (specially in 1558, in 1633, in 1643, in 1683 and during the whole 1700s). Finally, in 1821, after the independence, Trujillo finally lost the status of capital city due to its insecure area. In conclusion, there was not much Spain did to protect Trujillo from the attacks except from building the Santa Barbara Fortress.