As you rightly say, the history of the pope's temporal power is sure to be complicated, but I would think the following points should be noteworthy as an overview.
To begin with, it is probably reasonable to assume that the Pope held non-trivial worldly authority ever since the Emperor Theodosius made the Christian church the state religion of the Roman Empire. In ancient times, there was generally far less division between spiritual and temporal powers. The title of Pontifex Maximus is noteworthy in this context, seeing as how it was claimed by the Emperors themselves and therefore coincides with the political head from the Principate era onwards, and was later also claimed by the Popes. That alone seems to indicate some connotation of worldly involvement. Further intercourse between the Popes and the emperors can be seen by the creation of the permanent office of the papal apocrisiaries. I would dare speculate that the Pope holding temporal power was probably a less controversial issue in the early church than it would have been since and during middle ages, when there would have been a more contentious balance of temporal power between the Holy Roman Emperor and the Roman Pontiff.
In the specific case of the Pope holding true monarchic powers, however, I think it's safe to say that they were definitely established with the donation of Pepin in 756 of what became known as the Papal States to Pope Stephen II in return for Stephen strengthening Pepin's authority as King of the Franks by anointing him (which in turn was in return for Pepin's support against the Lombards). However, to further drive the point that the Pope's temporal authority was not an innovation by this donation, it should be noted how previous Popes held some worldly control of Rome itself and fluctuating territories outside of Rome. For instance, Gregory III oversaw the reconstruction of the Walls of Rome as against the Lombards. Gregory II used his authority to drive the governor of the Emperor (by that time, seated in Constantinople) in Rome from the city. As early as the sack of Rome in 410, Innocent I was one of the envoys sent to Ravenna by the Senate, indicating his involvement in worldly affairs.
The Vatican is just what is left of the Papal States since everything else was taken by the Carbonari during the Risorgimento. It is noteworthy, in this context, that the Popes did not formally accept that situation for more than half a century (after which the Vatican was recognized as a sovereign principality), considering themselves prisoners in the Vatican. By this time, the idea of the Pope wielding temporal powers had become so entrenched that, as Wikipedia puts it, "they claimed that total sovereignty was needed so that a civil government would never attempt to interfere in the governance of the universal Roman Church."