the island was, once again in its history, joined to North Africa as part of the Exarchate of Africa. The Arab conquest of North Africa caused a considerable number of Berbers, who had found themselves displaced by the war, to migrate to Sardinia as refugees, where they were welcomed and swiftly assimilated to the Sardinian ethnic element. At the same time, Sardinian colonies were established in the Maghreb, by which only Western Algeria and Morocco were once referred to, and Ifriqiya (broadly corresponding to modern Tunisia), like the settlement of Sardāniya ("Sardinia") in the vicinity of Al Qayrawān that, according to the scholar Giuseppe Contu, would later change its name into Sbikha. During the Middle Ages, the "Sardinian Nation" (Nació Sarda or Sardesca, as reported from the native and Aragonese dispatches) was juridically divided into four independent Kingdoms (known individually in Sardinian as Judicadu, Giudicau or simply Logu, that is "place"; in ); all of them, with the exception of Arborea, fell under the influence of the Italian maritime republics of Genoa and Pisa, as well as some noble families from the two cities, like the Dorias and the Della Gherardescas. The Dorias founded the cities of Alghero and Castelgenovese (today Castelsardo), while the Pisans founded Castel di Castro (today Cagliari) and Terranova (today Olbia); the famous count Ugolino della Gherardesca, quoted by Dante Alighieri in his Divine Comedy, favored the birth of the mining town of Villa di Chiesa (today Iglesias), which became an Italian medieval commune along with Sassari and Castel di Castro. Following the Aragonese conquest of the Sardinian territories under Pisan rule, which took place between 1323 and 1326, and then the long conflict between the Aragonese Kingdom and the Judicate of Arborea (1353–1420), the newborn Kingdom of Sardinia became one of the Associate States of the Crown of Aragon. The Aragonese repopulated the cities of Castel di Castro and Alghero with Spaniards, mainly Catalans. A local dialect of Catalan is still spoken by a minority of people in the city of Alghero. Modern and contemporary history In the 16th and 17th centuries, the main Sardinian cities of Cagliari (the capital of the Kingdom), Alghero and Sassari appear well placed in the trade routes of the time. The cosmopolitan composition of its people provides evidence of it: the population was not only indigenous, but also hailing from Spain, Liguria, France and the island of Corsica in