Spain in the 19th century was a country in turmoil. Occupied by Napoleon from 1808 to 1814, a massively destructive "liberation war" ensued. Following the Spanish Constitution of 1812, Spain was divided between the constitution's liberal principles and the absolutism personified by the rule of Ferdinand VII, who repealed the 1812 Constitution for the first time in 1814, only to be forced to swear over the constitution again in 1820 after a liberal pronunciamiento, giving way to the brief Trienio Liberal (1820–1823). This brief period came to an abrupt end with Ferdinand again abolishing the 1812 constitution and the start of the Ominous Decade (1823–1833) of absolutist rule for the last ten years of his reign.
Economic transformations throughout the century included the privatisation of communal municipal lands—not interrupted but actually intensified and legitimised during the Fernandine absolutist restorations —as well as the confiscation of Church properties. The early century saw the loss of the bulk of the Spanish colonies in the New World in the 1810s and 1820s, except for Cuba and Puerto Rico.