Faro, Portugal
Following the Restoration War, in the reigns of King Afonso VI and his brother, regent (then King) Peter II, the coastal lands were infested with Barbary pirates that anchored in the coastal coves and unprotected anchorages, then attacked and pillaged the local towns. Carrapateira was erected between two beaches, where pirates could easily disembark: Praia da Bordeira (to the north) and Praia do Amado (to the south). From these beaches, Barbary pirates targeted local homes, kidnapping many and selling them into slavery in the markets of Algiers. Similarly, in Arrifana, which formed a small cove protected by strong waves and easy access to the sea. Therefore, in the 17th century, they national government  constructed the Fort of Arrifana; erected in 1635, rebuilt in 1635 and 1670, it was originally established to protect a fishing port that existed by 1516.