Following the Hidalgo affair, Amadeus famously declared the people of Spain to be ungovernable, and fled the country. In his absence, a government of radicals and Republicans was formed that declared Spain a republic.
The republic was immediately under siege from all quarters the Carlists were the most immediate threat, launching a violent insurrection after their poor showing in the 1872 elections. There were calls for socialist revolution from the International Workingmen's Association, revolts and unrest in the autonomous regions of Navarre and Catalonia, and pressure from the Roman Catholic Church against the fledgling republic.