Its proximity to the sea meant that for centuries Mazarrón suffered constant threats from pirates from North Africa. The San Andrés Church was erected from the 16th century as a refuge for the population and as a place of prayer.

In the middle of the 16th Century the Marchioness of Villena gave the locality a building of incalculable historic, religious and cultural value, but also a refuge – as was the Los Vélez Castle or the Marquis of Villena strong house. This defensive building therefore housed many generations who constantly had to abandon their homes to flee and find shelter from the Berber pirate incursions.

The temple – declared of Cultural Interest – was built in 1543 and had a different form to the current church. There remains the body corresponding to the original building in the form of a rectangular nave. The main entrance door is to the south and features around it the shields of the Villena, Guzmán, Cisneros and Enríquez families, among others – all linked to the same house. The two nobility shields are surrounded by laurels and fruit, framed by an alfiz.

Also from this original temple the beautiful Moorish craftsmanship stands out. The tracery of the coffered ceiling is of particular artistic value.

Eighteenth century reforms also gave it other elements to be admired. The transept was added, increasing the original height of the building, and also the Main Chapel. These elements gave it an unmistakeable Baroque aesthetic.

Also from this period the pictorial supporting walls stand out, an ancestral technique which was established during this period in the most noble buildings, and which once can see in the mural decoration of the Main Alter piece. Strong, but plain colours are used to paint this alter piece, yellow dominating over red. It has the representation of Saint Andrew, Sain Fernando and Saint Clement.