What Year Did Mexico Gain Independence?

The Treaty of Cordoboa recognized Mexico’s independence and this was signed in 1821. This treaty was signed at the end of the Mexican War of Independence which went on from 1811 to 1821.