Ayala Castle, locally known as Castillo de Ayala, Castillo de Santa Bárbara or simply Castillo de Cox, lies in the center of the town of Cox in the province of Alicante in Spain.
Ayala Castle was built during the early 12th century during Muslim rule. It was built on a rocky spur in the northern foothills of the Sierra de Callosa de Segura and served to protect the rural village of Cox.
In 1226 the area was conquered by Alfonso X of Castile. After that the estate was managed by a muslim estate; the Ra'is de Crevillente, until their descendants died out in the early 14th century. In 1304 it was incorporated into the Kingdom of Valencia and around 1318 the castle was ceded to a Arardo de Mur by James II of Aragon. The son of Arardo sold it in 1339 to the Vidal family.
In the 15th century it belonged to the Dávalos family and around 1446 Juan Ruíz Dávalos rebuilt the castle and made it into a fortified manor house.
At the end of the 16th century Ayala Castle ceased to be inhabited by its owners and was left to fall into decay.
At present the interior of Ayala Castle can not be visited. Deprived of its battlements the castle doesn't much look like a castle. That, together with the fact that it is closed, makes it not very interesting. Although I would like to take a look inside its keep. Mora Tower is nearby.