In a region which is intimately linked with the sea and its riches, populations have long been establishing themselves along the coastline, exploiting marine resources, simultaneously blessed with the ease of contact with the sea and vulnerable to the evil intentions of some people brought to their door by the immense ocean.
In order to address these dangers, defensive systems were created throughout the centuries. These were of varying effectiveness, more or less in step with the military innovations which threatened them and especially conditioned by the political and economic stability of a country whose nerve centre was too far away.
In the municipality of Tavira, there are various examples of coastal defensive structures. However, of all the known structures on the coastline, only three have survived. The others were lost in time (due to their abandonment when their defensive qualities became obsolete), and are only known due to their having been recorded in historical texts. The oldest of the three structures is the circular tower at the site of Torre d’Aires, which was followed by the construction of Forte do Rato and Forte de S. João em Cabanas.
At the advent of modern times, the city of Tavira witnessed great vigor and development which dwindled when the course of the Gilão River was diverted. The movements of armies departing for the conquests in North Africa and in defense of the areas which were under threat contributed much to this splendor. These factors helped Tavira to very quickly become the chief region of the Algarve, since it served as a port of call for all [ships] and a departure point for passengers and goods from the region, which included lots of honey, wax, leather goods, dried fish, dates, horses and livestock, among others, which brought great wealth to the land.
Commerce and the conquest campaigns, as well as the almadravas (traditional tuna fishing craft or armações do atum) brought great economic prosperity to the Algarve, but also a big problem: pirates and privateering. Boats, almadravas and villages became attractive, often being soft targets. In 1577, Brother João de S. José, author of Corografia do Reino do Algarve (Chorology of the Kingdom of the Algarve), described the instability in Tavira due to enemies who often carried out exercises on this coastline, which they [the noblemen residing in Tavira] watched over day and night in summertime, with their feet in stirrups and a lance in their hand. The incursions carried out into enemy territory by the Berbers were frequent and violent between the months of April and September, and were aimed at the following: obtaining agricultural products and tuna. Sometimes people were captured and reduced to lavery.
According to Valdemar Coutinho, what forced the Portuguese to take more defensive than offensive measures from the XVIth century onwards was above all the political and religious attitudes in Magreb. Religious leaders linked to a Zawiya (a type of convent), with great power over the people, incited political leaders to Yihad (jihad) against the Christians of North Africa and against the southern coast of the Iberian Peninsula, through attacks by privateers and pirates, which had devastating effects on the coastal populations.