the first of which Tavira in August 1266. Under the reign of King Dinis (1279–1325), the castle was repaired and reinforced and the village fence expanded around the year 1292. The sovereign, by Royal Letter of April 15, 1303, extended the privileges of the residents, preventing their property from being seized or sold except for debts with the Crown. At the time of the 1383-1385 succession crisis, the Master of Avis, future John I of Portugal (1385-1433) donated Reguengo de Tavira to Fernão Álvares Pereira, brother of Constable Nuno Álvares Pereira. Later, after the conquest of Ceuta, started the process of the Portuguese Discoveries, the village would see its strategic and economic importance increase. The castle, however, showed risk of collapse, according to the complaint of its people before the courts of 1475. Under the reign of Manuel I of Portugal (1495–1521), the village received the "Foral Novo" (1504), raising it to city status on March 16, 1520, among other important privileges. Vasco Eanes Corte-Real was the Alcaide-mor at the time. In 1573, when King Sebastian (1568–1578) visit Tavira, construction work on the Santo Antonio Fort (Forte do Rato), in front of the Gilão river bar in 1577, was in progress. 18th century to modern day Later, in the context of the Portuguese Restoration War, John VI of Portugal (1640–1656) confirmed all the privileges granted to Tavira by his predecessors, determining works to modernize the medieval castle, reinforcing its structure and adapting it to the shots of the then modern artillery. The defense of the village was complemented, in 1672, by the beginning of the construction of the São João da Barra de Tavira Fortress, in Gomeira, bordering the Gilão river in 1717. In the 18th century, the castle's structure was severely damaged by the 1755 Lisbon earthquake, which certainly contributed to the fact that, in the following centuries, the defensive perimeter of the settlement was dismantled to a great extent. The Tavira Castle walls are classified as a National Monument by decree published on May 16, 1939. Architecture The walls of Tavira show various construction stages, the oldest of which dating back to the Almoravid period in the late eleventh century or early twelfth century. Although difficult to identify, it is believed to have been integrated by an alcove in the southeast angle and by a walled enclosure oriented in the north–south direction, both of modest dimensions. This initial