This conquest, however, placed the kings of Aragón in a position of antagonism with the popes, who defended the rights of the House of Anjou. Martin IV having excommunicated Peter III, the Aragónese nobles took advantage of the fact to extend their privileges at the expense of the royal power. The demands of the nobles increased in the reign of Alfonso III, who was forced to confirm to them the famous Privilegio de la Union. James II became reconciled with the Holy See, accepting Corsica and Sardinia in lieu of Sicily. Peter IV, the Ceremonious, defeated the nobles at Epila (1348) and used his dagger to cut in pieces the charter they had extorted from his predecessors. In the meantime the Catalans and Aragónese who were left in Sicily offered themselves to the Emperor Andronicus Palaeologus to fight the Turks. Having conquered these, they turned their arms against the Greeks, who treacherously slew their leaders; but for this treachery the Spaniards, under Bernard of Rocafort and Berenguer of Entenca, exacted the terrible penalty celebrated in history as "The Catalan Vengeance" and moreover seized the Duchies of Athens and Neopatras (1313). The royal line of Aragón became extinct with Martin the Humane, and the Compromise of Caspe gave the Crown to the dynasty of Castile, thus preparing the final union. Alfonso V, the Magnanimous, once more turned Aragónese policy in the direction of Italy, where he possessed the Kingdom of Sicily and acquired that of Naples by having himself made adoptive son of Queen Joanna. With these events began the Italian wars which were not to end until the eighteenth century.