Following the Hidalgo affair and an army rebellion, Amadeus famously declared the people of Spain to be ungovernable, abdicated the throne, and left the country (11 February 1873).
In his absence, a government of radicals and Republicans was formed that declared Spain a republic.