The history of Grottaferrata identifies largely with that of the Basilian Monastery of Santa Maria, founded here in 1004 by Saint Nilus the Younger. The legend narrates that, at the spot where the abbey now stands, the Virgin appeared and bade him found a church in her honour.
From Gregory, the powerful Count of Tusculum, father of Popes Benedict VIII and John XIX, Nilus obtained the site, which had been a Roman villa, where among the ruins there remained a low edifice of opus quadratum that had been a sepulchral monument but had been converted to a Christian oratory in the fourth century. Its iron window grates gave the site the name, first of Cryptoferrata then of Grottaferrata, commemorated in the coat-of-arms of the commune.
Nilus died soon afterwards (26 December 1005) in the Sant' Agata monastery in Tusculum. The building was carried out by his successors, especially the fourth abbot, Saint Bartholomew, who is usually considered the second founder. Building materials scavenged from the ruined villa were incorporated into the new structure, marble columns, sections of carved cornice, and blocks of the volcanic stone called peperino. The sanctuary was complete enough in 1024 to be consecrated by the Tusculan Pope John XIX.