At the time of the Christian Reconquest of the Iberian peninsula, the forces of King D. Sancho II (1223-1248) invested into the South, following both banks of the River Guadiana, conquering Mértola (on the right bank) and Ayamonte (left) (1238). Mértola was donated to the Order of Santiago, in the person of their Grand Master, D. Paio Peres Correia (1239).
In 1254 the town received charters, raised to the condition of village.
Under the reign of King D. Dinis (1279-1325), the primitive defense wall was rebuilt, and was initiated the wall around the village, work continued by his successors, D. Afonso IV (1325-1357), D. Pedro I (1357-1367) and D. Fernando (1367-1383).
Despite the importance of their position, strategic in southern Portugal, the village of Mértola and its castle, lost importance during the Portuguese Discoveries. The castle experienced a decline thereafter, which resulted in the conservation of its walls, so that in 1758, was partially ruined and lacked even the garrison.
The Castle was declared as a Public Interest Building in August 18th, 1943, and after that, as a National Monument in January 5th, 1951.
Due to the implementation of a revitalization project, Mértola today is considered a town-museum, with different areas of intervention and research, organized into three sections, on display in the Keep of the castle: the Roman section, the Visigothic section, including a Christian basilica, and the Islamic section, where one can see one of the best Portuguese collections of Islamic art (pottery, coins and jewelry).
-- Source