The Castle of Tavira (Portuguese: Castelo de Tavira) is a medieval castle located in the parish of Santiago, Tavira municipality, Faro district of Portugal. In a dominant position over the mouth of the river Gilão, the settlement has developed as an important sea port since antiquity, with its predecessors dating back to the 8th century BC, passing through the hands of Phoenicians, Greeks, Celts, Carthaginians, Romans, Moors and the Portuguese crown. History Early history Although the early human occupation of the region dates back to prehistoric times, an archaeological campaign undertaken in 1997 revealed a Phoenician wall of section dating from the eighth century BC. This colony of sailors and traders was the first proof of establishment. When the Romans invaded the Iberian Peninsula, the village, then called Balsa, acquired strategic importance due to the presence of a bridge over the river. The town later came under the control of the Moors in their conquest of the region. Medieval era At the time of the Christian reconquest of the peninsula, Portuguese forces reached the eastern Algarve from 1238. Tavira was conquered on June 11, 1239 (May 1240, according to Alexandre Herculano or even 1242 according to other sources), by the forces under the command of D. Paio Peres Correia, Master of the Order of Santiago. Tradition associates this achievement with a reprisal by that Order for the death of seven of its knights in an ambush while hunting on the site of Antas, in the current parish of Luz. On January 9, 1242 (or 1244 according to other sources), Sancho II of Portugal (1223-1248) donated the domains of Tavira and the patronage of his church to the Order of Santiago, a donation confirmed in 1245 by Pope Innocent IV. Pretending that the city had been conquered by a Castilian Military Order, Alfonso X of Castile claimed it for himself, coming to impose siege and conquer it in 1252. The following year, a treaty was signed by which Alfonso III of Portugal (1248-1279) would marry Afonso X's daughter and, if that union resulted in a son who would turn seven, his maternal grandfather would give him the gift of the Algarve. Since the conditions of this legislation were fulfilled in 1264, Afonso X delivered the Algarve to Afonso III by letter of 20 September, set in Seville. Because of this act, the Portuguese sovereign granted foral letters to various Algarvian villages,