Finally On December 28, 1836, Spain recognized the independence of Mexico under the Santa María–Calatrava Treaty, signed in Madrid by the Mexican Commissioner Miguel Santa María and the Spanish state minister José María Calatrava.[11][12] Mexico was the first former colony whose independence was recognized by Spain; the second was Ecuador on February 16, 1840.