As it lay outside the Aurelian Walls, the basilica was damaged in the 9th century during a Saracen raid. Consequently, Pope John VIII (872–82) fortified the basilica, the monastery, and the dwellings of the peasantry, forming the town of Johannispolis (Italian: "Giovannipoli") which existed until 1348, when an earthquake totally destroyed it.