Throughout the 19th century Spain made treaties of peace and recognition with each of the states established from its former colonies in Spanish America.
After the Cortes of Cádiz – which served as a parliamentary Regency after Ferdinand VII was deposed – was established in 1810, many Spanish Empire territories decided to declare independence.
When Ferdinand VII returned to the throne, he refused to accept these declarations and promised that he would retake all the territories, by force if necessary.
In 1834 the Regnant Queen Isabella II of Spain decided that times had changed, that a more modern approach was needed, and started consulting other members of her government.
The process was less conflictive than the government thought, but several diplomatic hurdles meant that 68 years passed until the last treaty was signed.