In order to solve the inconveniences derived from the distribution of the Murcia territory, and to other minor questions, was agreed a meeting between Ferdinand IV and James II of Aragon in the Monastery of Santa María de Huerta, located in the Province of Soria.

This meeting took place on 26 February 1305, and was attended by the Kings of Castile and Aragon, John of Castile, Juan Núñez II de Lara, Juan Manuel of Villena, Violante Manuel and her husband the Infante Afonso of Portugal, the Archbishop of Toledo and the Bishops of Sigüenza and Oporto, among others.
In exchange for her renunciation of the Lordships of Elda and Novelda, which would become part of the Kingdom of Aragon, Violante Manuel (sister of Juan Manuel), received the Lordships of Arroyo del Puerco and Medellín from Ferdinand IV, who at the same time gave to Juan Manuel the Lordship and Castle of Alarcón as compensation for his resignation to the possession of Elche.
Juan Manuel took possession of the town of Alarcón on 25 March 1305.

On the other hand, James II of Aragon, in spite of the insistence of Ferdinand IV, refused to hand over the Lordship of Albarracín to Juan Núñez II de Lara, who blamed his hitherto ally John of Castile for the low influence exerted on his behalf, and in consequence began to distance from him.
On the other hand, Fernando IV and James II granted powers to Diego García de Toledo, Chancellor of the seal of the Puridad, and to Gonzalo García, advisor of the Aragonese monarch, respectively, so that both personages concluded the distribution of Kingdom of Murcia between both Kingdoms, following the terms of the Treaty of Torrellas.

Finally, the delegates of both monarchs reached an agreement that was expressed in the Treaty of Elche, signed on 19 May 1305, and which definitively established the border of the Kingdom of Murcia, which had been divided between Castile and Aragon.
The dividing line between the two Kingdoms was established between Pechín and Almansa (who belonged to Ferdinand IV) and Caudete (who passed to James II).
The dividing line established between the two kingdoms in the territory of Murcia would follow the course of the Segura river from Cieza, corresponding to Castile the possession of Murcia, Molina de Segura and Blanca, as well as the city of Cartagena, which James II resigned because was located in the inner south of the Segura river, and that belong definitively to the Kingdom of Castile and León.
Nevertheless, the transfer of the city of Cartagena to Castile was made on condition that Ferdinand IV respected the property of Juan Manuel of Villena on the Lordship de Alarcón, to which the Castilian monarch didn't oppose.
At the same time, in the Treaty of Elche was arranged that the municipality of Yecla would continue in the possession of Juan Manuel, and his jurisdiction would correspond to Castile.

The partition of the Kingdom of Murcia, which didn't take into account the historical ties of the region, meant that the northern part would correspond to the Kingdom of Aragon, which sought to assimilate it immediately to the rest of his dominions, while the southern part, including Cartagena and the city of Murcia, passed definitely to Castilian hands.
In order to solve the inconveniences derived from the distribution of the Murcia territory, and to other minor questions, was agreed a meeting between Ferdinand IV and James II of Aragon in the Monastery of Santa María de Huerta, located in the Province of Soria.
This meeting took place on 26 February 1305, and was attended by the Kings of Castile and Aragon, John of Castile, Juan Núñez II de Lara, Juan Manuel of Villena, Violante Manuel and her husband the Infante Afonso of Portugal, the Archbishop of Toledo and the Bishops of Sigüenza and Oporto, among others. In exchange for her renunciation of the Lordships of Elda and Novelda, which would become part of the Kingdom of Aragon, Violante Manuel (sister of Juan Manuel), received the Lordships of Arroyo del Puerco and Medellín from Ferdinand IV, who at the same time gave to Juan Manuel the Lordship and Castle of Alarcón as compensation for his resignation to the possession of Elche. Juan Manuel took possession of the town of Alarcón on 25 March 1305.
On the other hand, James II of Aragon, in spite of the insistence of Ferdinand IV, refused to hand over the Lordship of Albarracín to Juan Núñez II de Lara, who blamed his hitherto ally John of Castile for the low influence exerted on his behalf, and in consequence began to distance from him. On the other hand, Fernando IV and James II granted powers to Diego García de Toledo, Chancellor of the seal of the Puridad, and to Gonzalo García, advisor of the Aragonese monarch, respectively, so that both personages concluded the distribution of Kingdom of Murcia between both Kingdoms, following the terms of the Treaty of Torrellas.
Finally, the delegates of both monarchs reached an agreement that was expressed in the Treaty of Elche, signed on 19 May 1305, and which definitively established the border of the Kingdom of Murcia, which had been divided between Castile and Aragon. The dividing line between the two Kingdoms was established between Pechín and Almansa (who belonged to Ferdinand IV) and Caudete (who passed to James II). The dividing line established between the two kingdoms in the territory of Murcia would follow the course of the Segura river from Cieza, corresponding to Castile the possession of Murcia, Molina de Segura and Blanca, as well as the city of Cartagena, which James II resigned because was located in the inner south of the Segura river, and that belong definitively to the Kingdom of Castile and León. Nevertheless, the transfer of the city of Cartagena to Castile was made on condition that Ferdinand IV respected the property of Juan Manuel of Villena on the Lordship de Alarcón, to which the Castilian monarch didn't oppose. At the same time, in the Treaty of Elche was arranged that the municipality of Yecla would continue in the possession of Juan Manuel, and his jurisdiction would correspond to Castile.
The partition of the Kingdom of Murcia, which didn't take into account the historical ties of the region, meant that the northern part would correspond to the Kingdom of Aragon, which sought to assimilate it immediately to the rest of his dominions, while the southern part, including Cartagena and the city of Murcia, passed definitely to Castilian hands.
Ferdinand IV of Castile