In 1288 King Edward Longshanks mediated to make peace, and Charles was liberated only 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 given 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 the Two Sidiies in 1289, and excommunicated King Alfonso III of Aragon. Charles of Valois, in alliance with Castile, prepared to take possession of Aragon. Alfonso, being hard pressed, 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.
The new Pope Boniface VIII, elected in 1294 at Naples under the auspices of King Charles, mediated between the latter and James, and a most dishonourable treaty 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 ensuring 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 Leonora 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 August 1309, and was succeeded by his son Robert the Wise.
His marriage in 1270 to Maria of Hungary, the daughter of King Stephen V of Hungary, brought the Angevin onto the Hungarian throne. His first-born son Charles Martel, who married Klementia von Habsburg, daughter of Rudolph I, Holy Roman Emperor, were parents of the later Charles I of Hungary. Charles II of Naples' second son Robert became King of Naples. The descendants of Charles II the Lame ruled the Hungary continuously from 1308 to 1395.