The Republican leaders planned the establishment of a federal republic, but did not declare it immediately, and instead planned a Constituent Cortes to write a federal constitution. The radicals preferred a unitary republic, and once the republic had been declared the two parties turned against each other; initially the radicals were largely driven from power, joining those who had already been driven out by the revolution of 1868 or by the Carlist War.
Subversion in the army, a series of local cantonalist risings, instability in Barcelona, failed anti-federalist coups, calls for revolution by the International Workingmen's Association, the lack of any broad political legitimacy, and personal in-fighting among the republican leadership all weakened the republic.
The Republic effectively ended on January 3 1874, when the Captain General of Madrid, Manuel Pavía, pronounced against the federalist government and called on all parties except Federalists and Carlists to form a national government. The monarchists and Republicans refused, leaving the unitary Radicals and Constitutionalists as the only group willing to govern; again a narrow political base. General Francisco Serrano formed a new government and was appointed President of the Republic although it was a mere formality since the Cortes had been dissolved.
Carlist forces managed to expand the territory under their control to the greatest extent in early 1874, though a series of defeats by the republic's northern army in the second half of the year might have led to the end of the war had it not been for bad weather. However the other monarchists had taken the name of Alfonsists as supporters of Alfonso, the son of the former Queen Isabel, and were organised by Cánovas del Castillo.
This period of the Republic lasted until Brigadier Martínez Campos pronounced for Alfonso in Sagunto on 29 December 1874, and the rest of the army refused to act against him. The government collapsed, leading to the end of the republic and the restoration of the Bourbon monarchy with the proclamation of Alfonso XII as king.
The Spanish Cortes, which were assembled in a joint and permanent session of both the Congress of Deputies and the Senate, declared themselves the National Assembly while waiting for any final notice from the King. The overwhelming majority was with the monarchists from the two dinastic parties that had exercised the government until then: the Radical Party of Manuel Ruiz Zorrilla and the Constitutional Party of Práxedes Mateo Sagasta. There also was a small republican minority in the National Assembly, ideologically divided between federalism and centralism. One of them, federalist parliamentarian Francisco Pi y Margall moved the following proposal:
The National Assembly assumes powers and declares the Republic as the form of government, leaving its organization to the Constituent Cortes.
In his speech for the proposal, Pi y Margall, himself a federalist, renounced for the moment to establish a federal republic, hoping the would-be-assembled Constituent Cortes to decide over the issue, and announced his acceptance of any other democratic decision. Then another republican, Emilio Castelar took the floor and said:
Sirs, traditional monarchy died with Ferdinand VII; parliamentary monarchy with the flight of Isabella II; democratic monarchy with the abdication of don Amadeo of Savoy; nobody has finished it, it has died on its own; nobody brings the Republic, save all circumstances, a cabal of society, nature and history. Sirs, let us greet it like the sun rising with its own strength on the sky of our nation.
After the powerful speech, a modified motion was passed with 258 votes in favour and only 32 against, declaring the Republic:
The National Assembly assumes powers and declares the Republic as the form of government, leaving its organization to the Constituent Cortes. An Executive Power shall be elected directly by the Cortes, and it shall be responsible to them.
In the same session, the first government of the Republic was elected. Federal republican Estanislao Figueras became the first "President of the Executive Power", an office incorporating the heads of State and Government. No "President of the Republic" was ever elected, as the Constitution creating such office was never enacted. The passage of these resolutions surprised and stunned most Spaniards, as the recently-elected Cortes (now National Assembly) had a wide majority of monarchists. Ruiz Zorrilla spoke in these terms:
I protest and will keep doing so, even if I'm left on my own, against those that having come to the Cortes as constitutional monarchists feel themselves authorized to take the decision to suddenly turn the nation from monarchist to republican.
For most monarchists, though, the impossibility of restoring Isabella II as Queen, and the youth of the future Alfonso XII made the Republic the only, though transitory, viable course of action, particularly given the inevitable failure that awaited it.
Their beginnings were plagued by a terrible economic situation, with a 546M peseta budgetary deficit, 153M in debts requiring immediate payment and only 32M available to fulfill them. The Artillery Corps had been dissolved in the most virulent moment of the Carlist and Cuban wars, for which there were not enough soldiers, equipments nor money to purchase them. Besides, Spain was going through a deep economic crisis matching the Panic of 1873 and which was exacerbated by the political instability. In previous years, unemployment had risen steeply amongst field and industrial workers, and proletarian organizations countered with strikes, demonstrations, protest rallies and the occupation of abandoned lands.
On February 23, the just-elected Speaker of the National Assembly, radical Cristino Marcos, plotted a failed coup d'etat in which the Civil Guard occupied the Ministry of Governation and the National Militia surrounded the Congress of Deputies, in order to establish an unitary republic. This prompted the first remodelation of the government in which the progressives were ousted and replaced with federalists. Twelve days after the establishment of the Republic, compulsory military service was removed and voluntary service set up with a daily salary of 1 peseta. A Republican volunteers corps was also established with a similar retribution.
The second Figueras government had to face the attempt of proclamation of the Estat Catalá inside the Spanish Federal Republic on March 9, which was overcome by a series of telegraphic contacts between the government and the Catalan leaders. On April 23, a new attempt of coup was set in motion; this time by a collusion of alfonsino monarchists, members of the old Liberal Union and monarchic sectors of the Army; but failed when several units refrained from supporting it.
Francisco Pi y Margall is usually considered the heart of the government, which had to face several problems already endemic to the Republic, as the Third Carlist War, separatist insurrections (this time from Catalonia), military indiscipline, monarchic plots, etc. The Government dissolved the National Assembly and summoned Constituent Cortes for May 1. On April 23, Cristino Martos, Speaker of the old National Assembly, attempted a new coup, now supported by the Civil Governor of Madrid: a platoon of militians took positions along the Paseo del Prado, and four thousand armed voluntaries more gathered near the Independence Square under the pretext of pasar revista. Having heard from the plot, Pi i Margall mobilized the Civil Guard, while the Minister for War appointed a new Captain General for Madrid and ordered him to march on the militians. The coup failed as soon as it started, and the Government dissolved the military units participating and the Permanent Committee of the Assembly.
The writs were issued for Constituent Cortes elections on May 10. The elections themselved developed in a quite unorthodox environment, and the resulting representativity was ridiculous, as most factions in Spain did not participate: the carlists were still waging war against the Republic, while the alfonsino monarchists of Antonio Cánovas del Castillo, the unitary republicans and even the incipient workers' organization close to the First International all called for abstention. The result was clearly favourable to the federal republicans, which captured 343 of the 371 seats, but turnout was probably the lowest in Spanish history, with about 28% in Catalonia and 25% in Madrid.
The form of government of the Spanish Nation is the Federal RepublicThe resolution was passed the next day, June 8, by a vote of 219-2, and the Federal Republic was thus declared. Most of the federalists in parliament supported a Swiss-like confederative model, with regions directly forming independent cantons. Famous Spanish writer Benito Pérez Galdós, aged 21 at the time, wrote about the Cortes in this terms:
The Constituent (Cortes) attracted me, and most afternoons I spent in the press tribune, watching the show of undescribable confusion cast by the Fathers of the Country. An endless individualism, the coming and going of opinions, from the most thought-out to the most extravagant, and the deadly spontaneity of most speakers, drove the spectator crazy and rendered the historic functions impossible. Days and nights went by without the Cortes deciding how should the Ministers be appointed: if they were to be individually elected by a vote of the house, or if it would be better to authorize Figueras or Pi to come up with a list of the new government. Each and every system was agreed on and later scrapped. It was a puerile game, which would cause laughter if it was not deeply sad.The situation reached such levels of surrealism that, while presiding over a Cabinet session, Estanislao Figueras yelled: «Gentlemen, I can't stand this any more. I am going to be frank to you: I'm fed up of all of us!». So fed up that on June 10 he left his resignation letter in his office, went for a walk through the Parque del Buen Retiro and, without telling anyone, boarded the first train departing from the Atocha Station. He would only step down upon arrival to Paris.
On June 16 a 25-member Committee was set up by the Cortes to study the draft Constitution of the Federal Republic of Spain, the redaction of which is mainly attributed to Emilio Castelar, with debate starting the following day. On June 28, Pi i Margall renewed the composition of his Government, but due to the slow pace of the constitutional debates in the Cortes, events came crashing down on the government at a stunning pace. On June 30, the City Council of Seville passed a motion declaring the town a Social Republic, and the next day many federalist deputies left the Cortes in protest. About a week later, on July 9, Alcoy followed suit, in the midst of a wave of murders sparked by a revolutionary strike directed by local leaders of the First International. It was just the beginning: shortly after, the cantonal revolution swept across Spain with strikes, murders of officers by soldiers, lynching of city mayors and over a hundred of deaths.