When the First Spanish Republic was established in 1873 after the abdication of Amadeo I, the first president, Estanislao Figueras, appointed Pi as Minister of the Interior.
During his ministerial tenure, Pi was responsible for the struggle against the cantonalist movement in the provinces.
On Figueras's resignation on 11 June, Pi was named president.
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.
His acquaintance with Proudhon enabled Pi to warm relations between the Republicans and the socialists in Spain.
However, Pi was unable to rein in the instability of the Republic; on the 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.

After the end of the Republic in 1874, Pi left political life for a decade.
During this time, he returned his attentions to his writings; only a few months after the end of the Republic, he wrote a treatise on its events, La República de 1873.
He followed this with Las Nacionalidades and Joyas Literarias in 1876.
The first volume of his Historia General de América was published in 1878, La Federación in 1880, and Las luchas de nuestros días and Observaciones sobre el carácter de don Juan Tenorio in 1884.
In 1886, he returned to politics and was elected deputy for Figueres, in Catalonia, and again in 1891 and 1893.
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 was involved in the 1883 Republican Congress of Zaragoza that proposed a federal republican constitution for Spain; in 1894, he was instrumental in reforming the republican movement with a new manifesto for the Federal Party.
In 1890, Pi founded the newspaper El Nuevo Régimen, which campaigned for Cuban independence.
Pi's promotion of federalism and regional autonomy earned him popularity among Catalan anarchists.

Pi died in Madrid on 29 November 1901 at the age of 77.
When the First Spanish Republic was established in 1873 after the abdication of Amadeo I, the first president, Estanislao Figueras, appointed Pi as Minister of the Interior. During his ministerial tenure, Pi was responsible for the struggle against the cantonalist movement in the provinces. On Figueras's resignation on 11 June, Pi was named president. 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. His acquaintance with Proudhon enabled Pi to warm relations between the Republicans and the socialists in Spain. However, Pi was unable to rein in the instability of the Republic; on the 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.
After the end of the Republic in 1874, Pi left political life for a decade. During this time, he returned his attentions to his writings; only a few months after the end of the Republic, he wrote a treatise on its events, La República de 1873. He followed this with Las Nacionalidades and Joyas Literarias in 1876. The first volume of his Historia General de América was published in 1878, La Federación in 1880, and Las luchas de nuestros días and Observaciones sobre el carácter de don Juan Tenorio in 1884. In 1886, he returned to politics and was elected deputy for Figueres, in Catalonia, and again in 1891 and 1893. 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 was involved in the 1883 Republican Congress of Zaragoza that proposed a federal republican constitution for Spain; in 1894, he was instrumental in reforming the republican movement with a new manifesto for the Federal Party. In 1890, Pi founded the newspaper El Nuevo Régimen, which campaigned for Cuban independence. Pi's promotion of federalism and regional autonomy earned him popularity among Catalan anarchists.
Pi died in Madrid on 29 November 1901 at the age of 77.
Francesc Pi i Margall