According to popular tradition, the Basilica was built in 1133 because they protect the people from the plague that was breaking down on Northern Italy. An inscription on the southern portal (the "White Lions") traces the construction in 1137, on the site of an existing church of the eighth century dedicated to the Virgin, in turn erected over a pagan temple dedicated to the goddess Clemency. The original plant was a Greek cross with five apses, a central and four on the transept, of which there remain three: the apse of the northwest was made to break down in 1472 by Bartolomeo Colleoni to make way for his mausoleum. The Basilica housed also held assemblies of people, according to a widespread practice during the period of free communes, but at the end of the thirteenth century the political situation changed: Bergamo passed to the Visconti, then to the Venetian Republic, and the building gradually lost its political and social role and remained only the spiritual one. During the fourteenth and fifteenth century, the work was resumed by the Masters Giovanni da Campione, with the addition of the baptistery and three porches. Between 1436 and 1459 was built the bell tower and between 1485 and 1491 the "new sacristy". In 1521 was created the southwest portal, said "Door of the Fountain". The building underwent other alterations inside during the seventeenth century, due to the interventions by Francesco Maria Richini, John Hall and John Angelo Barberini. In the same period was also remodeled the lantern.