On 11 February 1873, the Cortes declared the Republic, but this was soon under threat from the Carlist insurrectionists, the nobility, the former moderates and a large hostile bourgeoisie. In Catalonia, federalists and internationalist workers made attempts to proclaim Catalonia a state. On 11 June, the federal Republic, with Francesc Pi i Margall as president, was declared but was overwhelmed by cantonal uprisings. Pi i Margall was replaced, and Castelar, who took over from him, handed power to the military and conservatives.