 Complete the following phrase:  The Napoleonic invasion provoked a crisis of sovereignty and legitimacy to rule, a new political framework, and the loss of most of Spanish America. In Spain, political uncertainty lasted over a decade and turmoil for several decades, civil wars on succession disputes, a republic, and finally a liberal democracy. Resistance coalesced around juntas, emergency ad hoc governments. A Supreme Central Junta, ruling in the name of Ferdid VII, was created on 25 September 1808 to coordinate efforts among the various juntas. Subsequently, a cortes or parliament was called, with representatives not only from Spain, but also Spanish America and the Philippines. In 1812, the Cortes of Cádiz drafted the Spanish Constitution of 1812. When Ferdid VII was restored to the throne in 1814, he repudiated the constitution and re-asserted absolutist rule. A military coup in 1820 led by Rafael del Riego forced Ferdid to accept the constitution again, which went back into force until Ferdid raised troops in 1823, and re-asserted absolutist rule again. The reinstatement of the constitution was a major factor in propelling New Spains elites to support 