after the army of hidalgo , largely made up of indians , swept through central mexico , razing haciendas and killing spaniards , he was captured , shot and beheaded in chihuahua in 1811 , and spanish loyalists put his head on display until mexico won its independence in 1821 .