Castillo de Cortegana is a medieval fortress in Huelva province built in 1253 and enlarged in 1293 under Sancho IV as part of the defensive Banda Gallega fortification line warning of Portuguese incursion. Over several centuries, the castle served to control the road crossing the Sierra de Aroche and connecting the Guadalquivir Valley with the Portuguese Alentejo through the Chanza River Valley. The fortress displays a trapezoidal form with two levels and features a prominent Torre del Homenaje from the 16th century, along with a main enclosure and surrounding barbican providing double protection. Severely damaged by earthquakes in 1685 and the Lisbon earthquake of 1755, the castle underwent multiple reconstructions. Today it functions as a museum year-round, hosting the famous Medieval Days celebration in August when the town celebrates its heritage within and throughout Cortegana.