Inhabited since very early pre-historic times (at least since 150,000 years ago), in the 9th century BC the island was occupied by the Phoenicians, later on by Carthage and, after this city was defeated and destroyed in the Third Punic War, by Rome, and under the Roman Empire enjoyed a remarkable prosperity. Raided by the Vandals in 456 AD, it was later included by the Eastern (Byzantine) Roman Empire. For many centuries Sardinia suffered raids by the Saracens from Spain, Africa and Sicily.
In the 12th century, under the influence of the republic of Pisa, the island was divided into four local districts - Gallura, Logudoro, Arborea, and Caralis - called "Iudicati", each ruled by a iudex, whose power little by little became hereditary. In 1241 the King of Sicily Frederick II appointed his son Enzo king of Sardinia.
In 1323 the Kingdom of Aragon began its conquest Sardinia; Arborea resisted and for a time was able to control almost the whole island, but its last ruler Eleanor of Arborea was defeated in the Battle of Sanluri on June 30, 1409, the population of Alghero was expelled and the city repopulated with Catalans.
After the merge of the Kingdoms of Castile and Aragon in Spain, Sardinia was incorporated into Spain and Sardinian mariners were in the royal Spanish fleet when on October 7, 1571, at the Battle of Lepanto, the Turkish fleet was defeated. On 2 September 1720 Sardinia passed to Vittorio Amedeo II Savoy, later to become King of Sardinia, the entity that in the following century was to become the Kingdom of Italy.