A town arose in this area in the 16th century, when the alums were exploited.
This battery is one of the 9 fortresses that Carlos III ordered to be built from Almería to Málaga to prevent the attack of Barbary pirates. The battery of San Ramón is located on the playazo beach of Rodalquilar, next to what in the 18th century was called Playa de los Castillejos,
It was built in 1764, during the reign of Carlos III, who ordered the construction of the fortress on a fossilized dune that had the objective of monitoring and controlling the coastline between Cerrico Romero and Cala de San Pedro, with whose fortress the river crossed. fire from their artillery, in order to defend the gold resources of the Rodalquilar mines against the attacks of the Barbary pirates. This battery was designed by José Crame, who estimated its cost at 200,000 reales de vellón, being financed by José Arias.
A defensive mission that was carried out by fifty men who rarely left the fortification and who had the support of a battery of four cannons, of which two are still preserved in the castle of San Ramón, Maite explained. Linares and Alberto Morales, managers of the Los Patios hotel and two of the owners, during a visit to the building.
The San Ramón battery, battered during the War of Independence, was alternately occupied by people without shelter and by police forces to guard the coast. It would not be until 1875 when the State decided to sell it to an individual for 1,500 pesetas.
It is a battery for 4 cannons made of masonry and a polygonal plan. The castle consists of 2 floors.