But Napoleon III also had problems elsewhere: all of Europe was up in arms, and revolutions and wars were in the air. The jockeying for power among the Europeans had already led to some unexpected results, including the Mexican War and the annexation of Texas to the US in the Western Hemisphere. The bigger events in central and northern Europe had also forced the European powers to withdraw their troops from Italy, and, by 1861, all of Italy except for Rome and Venetia had achieved independence and sent delegations to the "Italian" Parliament meeting in Turin. There, on March 13, Victor Emanuel II was proclaimed King of Italy. Venetia was added to the new Italian Kingdom in 1866 as a result of Prussian successes in the north.
That same year, Napoleon III withdrew the French garrison that had sent to Civitavecchia to protect the Pope in Rome: after long negotiations he had made an agreement with the new Italian Kingdom to do so, and he also knew he would need every soldier he could find for the defense of French territory after Prussia finished its forcibly unification of Germany. A weak French "foreign legion" was organized for Rome's defense, but it was not enough to keep Garibaldi and his insurgents from attacking the Papal States in the autumn of 1867. (Garibaldi was essentially freelancing at this time and not really under control of the Italian government.) Napoleon spared two divisions for the Pope and sent them back to Rome. They combined with the Pope's own troops and repulsed the Garibaldi attack.
But on July 20, 1870, the long expected Franco-Prussian War broke out and Napoleon III desperately needed those troops from Rome. The French divisions withdrew from Civitavecchia on August 19, but they were too late to help Napoleon's cause. Napoleon asked Italy for help against the Prussians, banking on his past support of Italy against Austria, but the Italians refused because of Napoleon's more recent support for the Pope. Napoleon III and his whole army were quickly overcome and he himself was captured at Sedan in north-eastern France on September 2. News of his capture reached the Italian government the next day, and the Italian army immediately marched on Rome, which now could expect no outside assistance. Victor Emanuel made one last plea to Pope Pius IX to settle the matter peacefully, but the Pope refused.
Without French help, the Papal forces in Rome were no match for the Italian Army. On September 20, after a few hours' bombardment, the Italian troops entered Rome through a breach in the Aurelian Walls at Porta Pia. They advanced down what is now Via Septembre XX toward the Papal residence at the Quirinale Palace, but they moved slowly enough to ensure the Pope's escape. The Pope and his court decamped and safely reached the Vatican. There, he and his successors remained as "Prisoners of the Vatican", resisting the 1871 Law of Guarantees (an Italian offer to provide for the safety of the Pope and to leave all religious authority in the hands of the Church) and all subsequent attempts to settle the question of how Italy would coexist with the Papacy.
That situation maintained until 1929 when the Lateran Treaty creating a new sovereign entity, the Vatican State, was signed by Mussolini's Italy and the Pope's representatives. By the same agreement, Catholicism became the state religion of Italy. The latter provision was dropped from a new Lateran Treaty in 1984.
There are two Museums to visit. The larger is the Central Museum of the Risorgimento, behind the Victor Emanuel Monument on Via San Pietro in Carcere. A much smaller museum commemorating the Bersaglieri Infantry unit that breached the wall at Porta Pia is actually in the Porta Pia at Piazzale Porta Pia, 2.
There are hundreds of books in Italian and in English on the Risorgimento, and some older general histories of Italy have quite useable sections of for the non-specialist. Histories written before World War II tend to give more detail on the Risorgimento, perhaps because the romance of the movement was still fresh in academic minds or because later historians felt it was necessary to use so many more pages for explanations of Fascism.