Upon recovering Moscow from the armies of the Polish–Lithuanian Commonwealth in 1612 at the close of the Time of Troubles, Prince Dmitry Pozharsky attributed his success to the divine help of the icon "Theotokos of Kazan", to whom he had prayed on several occasions. From his private funds, he financed construction of a wooden church to the Virgin of Kazan on Red Square in Moscow, which was first mentioned in historical records in 1625. After the diminutive shrine was destroyed by a fire in 1632, Tsar Michael I, ordered it replaced with a brick church. The one-domed edifice, featuring several tiers of kokoshniki, a wide gallery, and a tented belfry, was consecrated in October 1636.