 James got together with Ferdinand IV of Castile in 1304 to fix new borders between their two states in Andalusia.Peace was effected between the two powers and the major part of Murcia was assigned to Castile.The cities of Cartagena, Orihuela, Elche, Caudete, Elda, and Alicante passed to the Kingdom of Valencia.