Built between 1798 and 1808 as a grain storehouse, the Alhóndiga became a fortress in 1810 when 300 Spanish troops and loyalist leaders barricaded themselves inside after 20,000 rebels led by Miguel Hidalgo attempted to take Guanajuato. On September 28, 1810, a young miner nicknamed El Pípila tied a stone slab to his back and, thus protected from Spanish bullets, set the entrance ablaze. The rebels moved in and killed everyone inside.
The Alhóndiga was later used as an armory, then a school, before it was a prison for 80 years (1864–1948). It became a museum in 1958, though it's arguably more interesting for its history than its display today. Don't miss José Chávez Morado's dramatic murals of Guanajuato's history on the staircases.