structural:expansion, information:highlighting
Mexican civil war

Independence forces under José Rafael de Iriarte arrived to the town on 4 October 1810. However, two months later royalist forces under Felix Calleja retook the locality, with insurrectionist sympathizers facing reprisals. About 2,000 insurgents on horses attacked the town but were repulsed by Count Pérez Gálvez. Royalist forces were attacked here in 1817 by Francisco Javier Mina without success. The town remained in royalist hands until the end of the Mexican War of Independence, when Agustín de Iturbide arrived. The town did not celebrate its first Grito de Dolores to mark independence until 1825. In 1827 it became one of the four "departments" of the newly created state of Guanajuato, and in 1830, it gained city status. In 1840, Father Ignacio Aguado founded the College of San Francisco de Sales and the College of La Madre Santísima was founded in 1844.