The castle in Tavira is a ruin with a garden inside it. The core is Moorish, from the 11th to the 13th century, built of rammed earth, but most of the visible masonry is younger: King Dinis's rebuilding around 1292 and the restorations of the 20th century. The many-sided tower is the castle's most unusual feature. Christian forces took the town around 1242, the earthquake of 1755 damaged the castle badly, and in the first half of the 19th century the castle yard was the town's cemetery. Since 1938 it has been a garden. From the walls you see the whole town, the river, the lagoon and the salt pans, and that view is the whole reason the walls are here.
Tavira only became a real town under the Moors. Excavations in the town centre have found nothing older than the 11th century; a single piece of Phoenician wall has been found in the town, but after that there are fourteen centuries of silence. The first walls were in all likelihood raised by the Almoravids in the late 11th or the 12th century, and the Almohads rebuilt in taipa, rammed earth pressed between shuttering. The many-sided albarrã tower is attributed to them; it has been rebuilt many times since. From 1144 Tavira kept itself independent under a succession of local lords, Ibn Munīb and later Alī al-Wahībī, withstood an Almohad siege in 1157 and only fell in 1167-68. The town within the walls covered a little over four hectares. Down by Praça da República a gate with a horseshoe arch was found; the remains stand in the Islamic museum room on the square. The shape is Arabic, like the town's name.
Between 1239 and 1242 the Christians conquered the town; the chronicle credits Dom Paio Peres Correia, grand master of the Order of Santiago. Legend says it was revenge: seven of the order's knights had been killed by Moors during a hunt at Antas while a truce was in force. King Sancho II gave Tavira to the order in 1244, and the crown got the town back in 1272. In 1266 Tavira became the first town in the Algarve to receive its charter, from Afonso III. King Dinis had the fortress rebuilt in 1292 with a keep and a curtain wall with seven gates. Porta de D. Manuel is Gothic and older than its name; Manuel I's coat of arms was added around 1500, and in 1520 he made Tavira a city and called it the Algarve's most important trading port.
From the 15th century the castle lost its military importance, although it received bastioned works after 1640. The earthquake of 1755 damaged it badly, and large parts of the town wall were taken down in the centuries that followed. In the first half of the 19th century the castle yard was Tavira's cemetery, busiest during the cholera epidemic of 1832. In 1938 the municipality bought the site and laid out the Jardim do Castelo, and the year after the castle was listed. What remains are several square towers, the many-sided tower and long stretches of the curtain wall. Open every day, in summer from 8.30 to 19.00.
At midnight on St John's Eve, they say in Tavira, a Moorish girl appears in the ruins. She was the daughter of the castle's Moorish lord, Aben Fabila, who enchanted her when Dom Paio stormed the town, and she waits for the one who can break the spell. In some retellings she rises out of a well, in others it was a Christian knight she loved.
Go up on the walls early in the day, before the sun is high, for the best light over the town and the river. Paio Peres Correia and the seven knights lie buried in the Igreja de Santa Maria do Castelo, a few metres from the castle gate; the church stands where the mosque was, and the clock tower is thought to be the minaret.
The hill by the Gilão was the place from which the ford across the river could be covered, before there was any bridge. That is why the Moors built here, and why Christians and Moors fought over the place. With artillery the castle lost its military importance from the 15th century, but it remained the governor's seat and a sign of royal power, and the walls were repaired again and again, after complaints at the Cortes of 1475 and with new works after 1640.
The castle stands as a ruin, but it is more restored than it looks: the state rebuilt the entrance arch and whole sections of wall in 1940, a stretch of wall in 1969 and consolidated the tower in 1982-89. The work secured and filled in; it did not build a new castle. That makes it less impressive from a distance but more honest up close: you can see the layers of taipa, medieval ashlar and 20th-century repairs in the same wall.