Castle of Xàtiva (Valencian: Castell de Xàtiva) is a castle located in the city of Xàtiva near Valencia, Spain. It is strategically located on the ancient roadway Via Augusta leading from Rome across the Pyrenees and down the Mediterranean coast to Cartagena and Cádiz.
In 1092, the castle fell into the occupation of the Almoravid dynasty who were expelled in an uprising that took place in 1145. During this uprising, the castle was besieged by the Governor of Valencia, Marwan Abd-al-Aziz. In 1171, the Castle finally fell, along with the rest of the Levante coast, into the hands of the Almohads.
King James I of Aragon began his crusade there in the summer of 1239, finally capturing Xátiva on 22 May 1244, following a five-month siege. After submitting to the Christian monarch and signing the Treaty of Játiva the Moors handed over the smaller nearby Castle to James I, while they were allowed to continue occupying the larger castle for another two years based on the terms of the treaty.