Antonio de Leyva, the Spanish governor of Milan and commander of the imperial troops, sacked the city in 1527. In the same year, a mine exploded causing the partial destruction of the Castle of Monza. De Leyva became Lord of Monza in 1529, devoting himself to the government regulation of ecclesiastical affairs, controlling their taxes and duties and shutting the doors of those who did not pay. His relative Marianna de Leyva was the inspiration to Alessandro Manzoni for his Nun of Monza.