Castillo de Matrera is a Spanish castle that originally dates to the ninth century and is located in the northeast of the province of Cádiz. It belonged to the kingdom of Alfonso X (in the thirteenth century). Today it is located in the municipality of Villamartín.