Cortegana is a town and municipality in the province of Huelva, in the Andalusia region of southern Spain. It is located in the western part of the province, within the Sierra de Aracena y Picos de Aroche area near the Portuguese border.
According to the 2005 census, Cortegana had a population of 4,952 inhabitants. The town is known for its medieval castle, the Castillo de Cortegana, a 13th–14th century fortress that stands on a hill above the town and is one of the best-preserved castles in the province of Huelva.