It is something studious people have been asking for centuries: what relation does the city of Rome (for one thousand four hundred years in the ‘temporal’ possession of the Catholic Pope) have with any movement that might demand Italian unity?
Pope Pius IX (Giovanni Mastai-Ferretti) was obliged to get out of Rome fast when a popular uprising drove him out of the Vatican. A Roman Republic was set up, mainly by the cleverness of Giuseppe Mazzini (politically) and Garibaldi (militarily). It was recognised officially in 1849.
Louis Napoleon in France, however, anxious to secure the Catholic vote at home, interfered by sending a French force to Rome (an act of war), which forced a way into the city (April to July, 1849). The Republicans were ejected. The Pope was restored, and a French garrison was left behind to guarantee his territorial rights.
The Kingdom of Italy was proclaimed in 1861, but Rome remained geographically within, but politically outside. Patriotic Italians were attracted towards Rome like filings to a magnet. Garibaldi tried to seize the city in 1862 but was himself taken prisoner by Italian troops at Aspromonte before he could contact the French.
Napoleon III saw that the Italians had moved the capital from Turin to Florence, and thuis believed they had renounced their Roman ambition. He withdrew his garrison, but back came Garibaldi with an army, organising asssaults on Rome. Louis Napoleon promptly sent his troops back and they defeated and captured Garibaldi at Mentana on 3 November.
In spite of attempts made by Louis Napoleon to settle The Roman Question in a series of international conferences, the French remained in Rome until August, 1870, when the calamitous outbreak of the Franco-Prussian War reclaimed them to defend France.
The Italian army broke through the walls of Rome on 20 September, 1870 (at the Porta Pia) and on 2 October, after a plebiscite (a direct vote by the electorate) Rome was annexed to Italy and became the capital; notwithstanding, many Popes refused to recognise the loss of their considerable possessions and saw themselves as nothing less than prisoners in the Vatican. This odd situation lasted until 1929 when the Lateran Treaty settled the dispute (and answered The Roman Question) by creating the Vatican City State.
The Lateran Treaties were arranged between the Italian Government and the Papacy. Vatican City was established as an independent state and included a Concordat (a special pact) which regulated the position of the Roman Catholic Church in Fascist Italy. The Pope who masterminded most of this was Pius XI (Pontiff 1922 – 39). The Papacy received a large indemnity for papal possessions lost to the Italian State in the 1870s. He then stopped saying he was a prisoner wuthin the Vatican.