During the Mexican War of Independence, the city was attacked several times by insurgents in 1812, 1814 and 1815. However, royalist forces were able to hold the city until Nicolás Bravo and Guadalupe Victoria took it in 1821, near the very end of the war. Bravo remained here for a time, founding a newspaper called El Mosquito de Tulancingo and constructing a gunpowder factory. This would lead to “de Bravo” being added as an appendage to the city's name in 1858. After Agustín de Iturbide was proclaimed emperor in 1822, he maintained a residence in Tulancingo, where he was supported by the populace. When Iturbide was dethroned, he withdrew from Mexico City to Tulancingo on his way to Veracruz and into exile.