maintained its own laws and administration, and looked after its own foreign and trading affairs. The history of the four Judicates would be defined by the contest for influence between the two Italian maritime powers of Genoa and Pisa, and later the ambitions of the Kingdom of Aragon. The Judicate of Cagliari or Pluminos, during the regency of Torchitorio V of Cagliari and his successor, William III, was allied with the Republic of Genoa. Because of this it was brought to an end in 1258, when its capital, Santa Igia, was stormed and destroyed by an alliance of Sardinian and Pisan forces. The territory then was divided between the Republic of Pisa, the Della Gherardesca family from Italy, and the Sardinian Judicates of Arborea and Gallura. Pisa maintained the control over the fortress of Castel di Cagliari founded by Pisan merchants in 1216–1217 east of Santa Igia; in the south-west the count Ugolino della Gherardesca promoted the birth of the town of Villa di Chiesa (today Iglesias) to exploit the nearby rich silver deposits. The Judicate of Logudoro (also called Torres) was also allied to the Republic of Genoa and came to an end in 1259 after the death of the (queen) Adelasia. The territory was divided up between the Doria and Malaspina families of Genoa and the Bas-Serra family of Arborea, while the city of Sassari became a small republic, along the lines of the Italian city-states (comuni), confederated firstly with Pisa and then with Genoa. The Judicate of Gallura ended in the year 1288, when the last giudice, Nino Visconti (a friend of Dante Alighieri), was driven out by the Pisans, who occupied the territory. The Judicate of Arborea, having Oristano as its capital, had the longest life compared to the other kingdoms. Its later history is entwined with the attempt to unify the island into a single Sardinian state ( 'Sardinian Republic' in Sardinian, or 'Sardinian Nation' in Catalan) against their relatives and former Aragonese allies. Aragonese period In 1297, Pope Boniface VIII established on his own initiative (motu proprio) a hypothetical regnum Sardiniae et Corsicae ("Kingdom of Sardinia and Corsica") in order to settle the War of the Sicilian Vespers diplomatically. This had broken out in 1282 between the Capetian House of Anjou and Aragon over the possession of Sicily. Despite the existence of the indigenous states, the Pope offered this newly created crown to James