It served as a papal residence and housed the central offices responsible for the civil government of the Papal States until 1870 .
The palace was a papal residence until 1870 .