The ancient convent of S. Margherita, founded by the Humiliati in the 13th century, partly derives its fame from the famous story of the Monaca di Monza, fictionalized by Manzoni in The Betrothed. Marianna de Leyva was heiress of the noble family then titular of the fief of Monza; at only 16 years of age, under the name of Sister Virginia, she became a nun in the Monza convent, whose walls would see the dramatic affair with Gian Paolo Osio, Manzoni's Egidio, which ended in 1608 with Osio's death sentence and Sister Virginia's imprisonment.
The present church was built in 1736; the terracotta façade is enlivened by the marble portal, while the interior, with a single nave, is richly frescoed a few years later by Carlo Innocenzo Carloni, an artist of international reputation, highly esteemed for his works in Austria, Germany and the Czech Republic, who produced on these walls and in the nearby Cathedral of Monza a pictorial cycle of noble refinement. From the end of the 19th century the church was merged with the title of the nearby church of San Maurizio, demolished for the widening of Via Vittorio Emanuele II.