The treaty was ratified by Spain in 1820, and by the United States in 1821 (during the time that Spain and Mexico were engaged in the prolonged Mexican War of Independence). Spain finally recognized the independence of Mexico with the Treaty of Córdoba signed on August 24, 1821.