Pi fled to Guipúzcoa in the Basque country until 1857, when Nicolás María Rivero asked him to return to Madrid to contribute to the Republican newspaper La Discusión.
At La Discusión, Pi became acquainted with a number of leaders of the Spanish republican movement, including another future president of the First Republic, Estanislao Figueras.
After the sergeants' revolt at San Gil in 1866, Pi fled to Paris, where he gave lectures and translated several of Proudhon's works and became familiar with French positivism.
Pi presented to the Cortes an ambitious plan of reform, including a law formalizing a stricter separation of church and state, the reorganization of the army, reduction of the working day to eight hours, regulation of child labor, enhancements to the relationship between business and labor, new laws regarding the autonomy of the regions of Spain, and a program of universal education.
However, Pi was unable to rein in the instability of the Republic; on 1 July, the more radical elements of the Republican party and federalists broke off and declared the government illegitimate, and new insurrections appeared in Alcoy and Cartagena only a week later.
Under pressure from the Cortes and many leading Republicans who accused him of dangerous weakness, Pi resigned the presidency on 18 July, only a little more than a month after he assumed the office.
He was involved in the fragmentation of the Spanish Republican movement in this period together with Estanislao Figueras, Manuel Ruiz Zorrilla, Emilio Castelar y Ripoll, and Valentí Almirall.
Pi i Margall became the principal translator of Proudhon's works into Spanish[6] and later briefly became president of Spain in 1873 while being the leader of the Democratic Republican Federal Party.
According to George Woodcock, "These translations were to have a profound and lasting effect on the development of Spanish anarchism after 1870, but before that time Proudhonian ideas, as interpreted by Pi, already provided much of the inspiration for the federalist movement which sprang up in the early 1860s.
"[7] According to the Encyclopædia Britannica "During the Spanish revolution of 1873, Pi i Margall attempted to establish a decentralized, or "cantonalist", political system on Proudhonian lines.
[11] He was wary of centralism (which was alien to the internal organization of the inhabitants of the Iberian peninsula and imposed on them, according to Pi), which he deemed to be, along with monarchy, one of the root reasons behind the state of decadence of the Peninsular peoples.