in the south and east, in the Judicates of Cagliari and Arborea. That was the cause of conflicts leading to a long war between the Judges, who regarded themselves as kings fighting against rebellious nobles. Later, the title of King of Sardinia was granted by the Emperor of the Holy Roman Empire to Barisone II of Arborea and Enzio of Sardinia. The first could not reunify the island under his rule, despite years of war against the other Sardinian judges, and he finally concluded a peace treaty with them in 1172. The second did not have the opportunity. Invested with the title from his father, Emperor Frederick II in 1239, he was soon recalled by his parent and appointed Imperial Vicar for Italy. He died in 1272 without direct recognized heirs after a detention of 23 years in a prison in Bologna. The Kingdom of Sardinia and Corsica (later, just the "Kingdom of Sardinia" from 1460) was a state whose king was the King of Aragon, who started to conquer it in 1324, gained full control in 1410, and directly ruled it until 1460. In that year it was incorporated into a sort of confederation of states, each with its own institutions, called the Crown of Aragon, and united only in the person of the king. The Crown of Aragon was made by a council of representatives of the various states and grew in importance for the main purpose of separating the legacy of Ferdinand II of Aragon from that of Isabella I of Castile when they married in 1469. The idea of the kingdom was created in 1297 by Pope Boniface VIII, as a hypothetical entity created for James II of Aragon under a secret clause in the Treaty of Anagni. This was an inducement to join in the effort to restore Sicily, then under the rule of James's brother Frederick III of Sicily, to the Angevin dynasty over the oppositions of the Sicilians. The two islands proposed for this new kingdom were occupied by other states and fiefs at the time. In Sardinia, three of the four states that had succeeded Byzantine imperial rule in the 9th century had passed through marriage and partition under the direct or indirect control of Pisa and Genoa in the 40 years preceding the Anagni treaty. Genoa had also ruled Corsica since conquering the island nearly two centuries before (c. 1133). There