In 1288, King Edward I of England mediated to make peace, and Charles was liberated on the condition that he was to retain Naples alone. Sicily was left to the Aragonese. Charles was also to induce his cousin Charles of Valois to renounce, for twenty thousand pounds of silver, the kingdom of Aragon, which had been given to him by Pope Martin IV to punish Peter for having invaded Sicily, but which the Valois had never effectively occupied.
Charles was then released, leaving three of his sons and sixty Provençal nobles as hostages, promising to pay 30,000 marks and to return a prisoner if the conditions were not fulfilled within three years. He went to Rieti, where the new Pope Nicholas IV immediately absolved him from all the conditions he had sworn to observe, crowned him King of Sicily in 1289, and excommunicated King Alfonso III of Aragon. Charles of Valois, in alliance with Castile, prepared to take possession of Aragon, reopening the Aragonese Crusade. Alfonso, being hard pressed, agreed to the conditions of the Treaty of Tarascon: he had to promise to withdraw the troops he had sent to help his brother James in Sicily, to renounce all rights over the island, and pay a tribute to the Holy See.
Alfonso died childless in 1291 before the treaty could be carried out, and James took possession of Aragon, leaving the government of Sicily to the third brother Frederick.
The new Pope Boniface VIII, elected in 1294 at Naples under the auspices of King Charles, mediated between the latter and James, and the dishonourable Treaty of Anagni was signed: James was to marry Charles’s daughter Bianca and was promised the investiture by the pope of Sardinia and Corsica, while he was to leave the Angevin a free hand in Sicily and even to assist him if the Sicilians resisted.
An attempt was made to bribe Frederick into consenting to this arrangement, but being backed up by his people he refused, and was afterwards crowned King of Sicily. The ensuing war was fought on land and sea but Charles, though aided by the pope, his cousin Charles of Valois and James, was unable to conquer the island, and his son the prince of Taranto was taken prisoner at the battle of La Falconara in 1299. Peace was at last made in 1302 at Caltabellotta. Charles gave up all rights to Sicily and agreed to the marriage of his daughter Eleanor and King Frederick; the treaty was ratified by the pope in 1303. Charles spent his last years quietly in Naples, which city he improved and embellished.
He died in Naples in May 1309, and was succeeded by his son Robert the Wise.
Charles, his wife Mary and their children in Bible of Naples
John of Gravina (1294 – 5 April 1336, Naples), Duke of Durazzo, Prince of Achaea, and Count of Gravina, married March 1318 (div 1321) Matilda of Hainaut (29 November 1293–1336), married 14 November 1321 Agnes of Périgord (d. 1345)
Beatrice (1295 – c. 1321), married April 1305 Azzo VIII d'Este, marchese of Ferrara etc. (d. 1308); she married secondly 1309 Bertrand III of Baux, Count of Andria (d. 1351)