The Lateran Palace was owned by an important Roman family as far back as 366 BCE. Through some political machinations, the Lateran eventually came under the direct control of the Emperor. When Constantine defeated Maxentius and assumed control over Rome, he presented the Pope Militiades with the Lateran Palace, which became the papal residence and seat of Christian governance.
Other donations followed, on the Italian peninsula, but also in the outlying provinces of the Roman Empire. The Church held all of these lands as a private landowner, not as a sovereign entity.During the 5th Century, the Church submitted to the sovereign authority of Ocacer, and later the Ostrogoths, while asserting spiritual primacy, through the Papacy of the Bishop of Rome, over the whole Church.
During the time of the reconquest of Italy by the Byzantine or Eastern Roman Empire (6th and 7th Centuries), the political infrastructure of Italy had pretty much disintegrated. The Papacy, as the largest and most influential landowner in the region, began to take on a lot of the ruling authority that the Byzantines were unable to exert in Rome and the surrounding areas. The Popes were technically Byzantine subjects, but in practicality, exercised great autonomy in ruling the Duchy of Rome.
That’s how it started. The Duchy or Rome evolved into a sovereign nation, known as the Papal States, which now has shrunk to the confined area known as Vatican City.