the creation of the Crown of Aragon. The Kingdom of Valencia became the third member of the crown together with Aragon and Catalonia. The Kingdom of Majorca had an independent status with its own kings until 1349. In 1282, the Sicilians rose up against the second dynasty of the Angevins on the Sicilian Vespers and massacred the garrison soldiers throughout the island. Peter III responded to their call, and landed in Trapani to an enthusiastic welcome five months later. This caused Pope Martin IV to excommunicate the king, place Sicily under interdiction, and offer the kingdom of Aragon to a son of Philip III of France. When Peter III refused to impose the Charters of Aragon in Valencia, the nobles and towns united in Zaragoza to demand a confirmation of their privileges, which the king had to accept in 1283. Thus began the Union of Aragon, which developed the power of the Justícia to mediate between the king and the Aragonese bourgeois. When James II of Aragon completed the conquest of the kingdom of Valencia, the Crown of Aragon established itself as one of the major powers in Europe. In 1297, to solve the dispute between the Anjevins and the Aragonese over Sicily, Pope Boniface VIII created ex novo a Kingdom of Sardinia and Corsica and entrusted it as a fief to the Aragonese King James II, ignoring already existing, indigenous states. In 1324, James II finally started to seize the Pisan territories in the former states of Cagliari and Gallura. In 1347 Aragon made war on the Genoese Doria and Malaspina houses, which controlled most of the lands of the former Logudoro state in north-western Sardinia, and added them to its direct domains. The Giudicato of Arborea, the only remaining independent Sardinian state, proved far more difficult to subdue. The rulers of Arborea developed the ambition to unite all of Sardinia under their rule and create a single Sardinian state, and at a certain point (1368–1388, 1392–1409) almost managed to drive the Aragonese out. The war between Arborea and Aragon was fought on and off for more than 100 years; this situation lasted until 1409, when the army of Arborea suffered a heavy defeat by the Aragonese army in the Battle of Sanluri; the capital Oristano was lost in 1410. After some years during which Arborean rulers failed to organise a successful resurgence, they sold their remaining rights for