In the beginning of the 7th century, after the moorish invasion of the Iberian Peninsula, the Castle of Loulé was just a small tower.

In 1249 in S. Clemente’s Day, D. Afonso III conquered Loulé.

When Portugal was living the crisis of 1383-1385, the village was facing some difficulties, and if Spain invaded Portugal it would be necessary  to repair the tower that topped the “Porta de Faro” and raise the walls and battlements on the southern flank of the village fence wall.??? D. João I was sensitive to this problem and so he granted the village special privileges to inhabit the interior of the Wall and donated a ruined house in front of the Church of São Clemente (current Mother Church) for the construction of a churchyard.

The walls of the castle were rebuilt in the 15th century with the cycle of the Portuguese Discoveries. At that time, the Algarve region was experiencing a new economic growth, from which Loulé had benefited, by exporting wine, olive oil, fruits, dried fish and salt. Thanks to these resources after 1422, the walls of the castle were rebuilt by D. Henrique de Meneses, 1stCount/Earl of Loulé.

After the Restoration of Independence, (1640) the Castle lost its defensive value because of the evolution of artillery. That way the urban growth absorbed the old walls, a process that was accelerated by the damages caused by the earthquake of 1755, which destroyed most of the village. The castle stands on one of the vertices of the city’s medieval fence: this fence defined a perimeter with an area of approximately five hectares and that can be divided into two main nuclei: the Alcáçova, an eminently military space; and the Medina, an essentially civil and administrative space. The remains of this set were three towers, one of which is a fortified tower (“albarrã”) that defines one of the sections of the Wall to the northeast which would function as the limit of the Alcáçova; the tower of “Vela” in Engenheiro Duarte Pacheco St (better known at Rua da Corredoura), and close to it the “Porta of Faro”.

In the southern part, called “Mouraria”, just outside “Porta of Faro” are the streets where the handicrafts facilities are thought to be located – proved by the old toponyms, some of which still exist today. In the inferior plane there is another fortified tower (“albarrã”) at Barbacã St that, as the name suggests (“barbacã” is barbican which means a fortified outpost or gateway, such as an outer defense of a city or castle, or any tower situated over a gate or bridge which was used for defensive purposes), there should have been a structure parallel to the walls that maybe was destroyed to open the street. From the primitive/early Medina remained a quadrangular tower that originally was the minaret from the Muslim Mosque, adapted after the Christianization as a bell tower from São Clemente’s church. In the 19th century the areas next to the walls of the castle were.