>>513839828
New Spain was a legit nation at the time. It more or less functioned like the English and Dutch East India companies, but it was a recognized nation with it's own army, navy and political body. They rebelled against Spain in 1821 and gained their independence, forming a (at the time) 'Mexican' empire.