Miguel Hidalgo y Costilla was a Catholic priest who declared war against the French colonists in 1811 but was later captured and executed, with his body hung in display. The Mexican War of Independence from 1810 to 1821 saw several key figures and battles work towards independence from Spain, which was recognized in 1821 with the Treaty of Cordoba between Spain and Mexico establishing Mexican independence and the modern Mexican flag.