The last inhabitants finally abandoned the crumbling civic center around the middle of the 7th century AD, when the socio-economic network of the town was shattered by another major earthquake, new epidemics and the first Arab raids. The transition from a farming society to pastoralism, mainly that of goats, eventually resulted in a massive erosion which covered the ruins of the abandoned city. As a result, Sagalassos, which was never looted in later periods, remained one of the best preserved ancient urban sites in the Mediterranean.