Sources
The capture of Rome (20 September 1870) and the Law of Guarantees (1871)
The entry of Italian troops into Rome through Porta Pia put an end to the Papal States. The Law of Guarantees (13 May 1871) offered the pope a unilateral position —immunities, revenue and the Vatican— which Pius IX rejected, declaring himself a prisoner.
Text of the Law of Guarantees: law of 13 May 1871, no. 214, Gazzetta Ufficiale of 18 May 1871 (text at https://www.normattiva.it/uri-res/N2Ls?urn:nir:stato:legge:1871-05-13;214). For the whole: B. King, A History of Italian Unity, II (London, 1899), pp. 377-382 (the capture of Rome and the Law of Guarantees).