In 1081, shortly after completion, the relics of the apostle Matthew, patron saint of the city, were buried in the crypt in the presence of Alfano I, Emperor Michele and Duke Roberto il Guiscardo. Pope Gregory VII officially consecrated the Basilica. The Basilica was destroyed in an earthquake on June 5, 1688 and and rebuilt in the 17th century.