The rule of the Popes was interrupted by the short-lived Roman Republic (1798), which was built under the influence of the French Revolution. During Napoleon's reign, Rome was annexed into the French Empire. After the fall of Napoleon, the Church State under the pope was reinstated through the Congress of Vienna of 1814.
In 1849, another Roman Republic arose within the framework of revolutions of 1848. Two of the most influential figures of the Italian unification, Giuseppe Mazzini and Giuseppe Garibaldi, fought for the short-lived republic.
Rome became the focus of hopes of Italian reunification when the rest of Italy was reunited under the Kingdom of Italy with a temporary capital at Florence. In 1861, Rome was declared the capital of Italy even though it was still under the control of the Pope. During the 1860s, the last vestiges of the Papal States were under the French protection Napoleon III. And it was only when this was lifted in 1870, owing to the outbreak of the Franco-Prussian War, that Italian troops were able to capture Rome entering the city through a breach near Porta Pia. Afterwards, Pope Pius IX declared himself as prisoner in the Vatican, and in 1871 the capital of Italy was moved from Florence to Rome.