In regard to Castles of Sardinia, most were built during the Byzantine period and the della Gherardesca, Malaspina and Doria domination, but with the unification of Sardinia under the Aragonese, their importance faded away and over time almost all of them went into ruin.
Between existing and disappeared there are 82 castles in Sardinia, all built during the Middle Ages. 
