Answer
Pius IX, the longest-reigning Pope in history, was effectively a "prisoner" within the Vatican City from 1870 to 1878 due to the unification of Italy and the loss of the Papal States. Confined to the Vatican, he refused to recognize the Italian state and maintained his claim to the former papal territories.