In 897, it was almost totally destroyed by an earthquake: "ab altari usque ad portas cecidit" ("it collapsed from the altar to the doors"). The damage was so extensive that it was difficult to trace the lines of the old building, but these were mostly respected and the new building was of the same dimensions as the old. This second basilica stood for 400 years before it burned in 1308. It was rebuilt by Pope Clement V and Pope John XXII. It burned once more in 1360, and was rebuilt by Pope Urban V.