 The king of The Taifa of Murcia signed a treaty with Castile in which the territory would became part of Castilian rule in 1243.However, the territory was Muslim until a Mudejar revolt in 1264-1266.The king James I of Aragon defeated the revolt.