The roots of the doctrine in its primative form actually reaches back to the views of very early church fathers. I add this history to show the period prior to people like Joachim described in the other post. The idea stems from a very early belief by church fathers that the antichrist would be a new form of government in the Roman Empire. A powerful papacy was not existent at the time so the connection was impossible to foresee but all the seeds of the belief were sewn by them, later appropriated by those witnessing papal abuses that fit the church father expectation.
The principal idea of the church fathers is rooted in the connection of the anti-Christ with the little horn that ‘has eyes’ and ‘speaks blasphemous things’ in Daniel Chapter 7. This expected soon-to-come antichrist from some sort of mysterious sinister change within the Roman Empire (this evil horn) was considered by the Fathers to include a dreadful 'apostasy of believers' which would start a terrible history of persecution against true believers who opposed the risen new Roman power. Therefore, the prayers of the fathers was that Rome would be kept safe from any such political changes. The hope was that the dreaded horn of antichrist and massive church apostasy would be kept at bay as long as possible as it was greatly feared.
One author has already collected this history of the church fathers on this subject providing to us a convenient collection of these origins to the view adopted by nearly all early protestant reformers:
All quotes from Horae Apocalypticae; or, A commentary on the Apocalypse, critical and historical; including also an examination of the chief prophecies of Daniel (1846). page 365
Cyril, ordained Bishop of Jerusalem A.D. 350 had this view.
He, like the fathers before him, explained the four wild Beasts of Dan. 7. to be the Babylonian, Persian, Macedonian, and Roman empires, and identified the fourth Beast’s little horn with St. Paul’s Man of Sin and St. John’s Antichrist. Further he judged that the time of his coming was to be when the times of the then Roman empire were fulfilled, (ὁταν πληρωθωσιν οἱ καιροι της των Ῥωμαιων βασιλειας,) and it was dissolved into ten kingdoms, kingdoms rising up contemporaneously, but in different places:—that then Antichrist, (“some great man raised up by the devil,”) falsely calling himself the Christ, and so seducing the Jews, would by magical arts and false miracles seize on, and usurp, the power of the Roman empire, eradicate three of the ten kings, and subjugate the other seven:—that at first mild in semblance, and prudent, and the abolisher of idols, (all with a view to self-exaltation,) he would afterwards show himself as God, sitting in the Jewish temple; (“for God forbid it should be that in which we are;”) and for three years and a half persecute the Church:—finally that the apostasy, of which St. Paul spoke as Antichrist’s precursor, meant a religious apostasy, “from the right faith, from truth, and from right words.” (So Catech. Lect. xv.)
Ambrose, ordained Bishop of Milan A.D. 374 contributed this view:
The only prophetical notices on the point proposed in the genuine writings of this father, are those in his Comment on Luke 21:20; Book x. § 15–18. He there (like Cyril) explains the apostasy of St. Paul to mean an apostasy from true religion: (“à verâ religione plerique lapsi errore deseiscent:”)—that it would be the Jewish inner or mental temple in which Antichrist would sit: and that then, seizing on the kingdom, (I presume the Roman kingdom or supremacy,) he would claim for himself a throne of divine authority; “sibi divinæ vindicet solium potestatis.”
In the Comment on 2 Thess. 2. of the Pseudo-Ambrose, the hindrance to Antichrist’s manifestation is explained to be the Roman empire; its defection (αποστασια), or abolition, being the occasion of his appearance; and that he would then restore freedom to the Romans, “sub suo nomine:”—that the mystery of iniquity spoken of by St. Paul was Nero’s persecuting spirit against Christians, which still afterwards had continued to actuate succeeding Pagan emperors down to Diocletian and Julian; finally that he would, “in domo Domini, in sede sedeat Christi, et ipsum Deum se asserat.”
Chrysostom, ordained Presbyter A.D. 386 expresses the same gist:
He too (on Daniel) expounded Nebuchadnezzar’s quadripartite Image, and Daniel’s four Beasts, as the other fathers. “The days of those kings,” said of the time of the stone being cut out, he explains as the days of the Romans: and that, in smiting and destroying the Roman kingdom, it would destroy the others too, as included.—Also in his” Hom. iv. on 2 Thess. 2 he made the Roman empire to be the let or hindrance to Antichrist’s manifestation meant by St. Paul: τουτʼ εστιν ἡ αρχη ἡ Ῥωμαικη· ὁταν αρθῃ εκ μεσου τοτε εκεινος ηξει· and again: ὁταν αὑτη καταλυθῃ επιθησεται (ὁ Αντιχριστος) τῃ αναρχιᾳ, και την των ανθρωπων και την του Θεου επιχειρησει ἁρπασαι αρχην· and he explained the temple in which Antichrist would sit to be rather “the Christian Churches everywhere,” than the Jewish temple.—The mystery of iniquity he thought might be Nero, as in spirit a type of Antichrist: Νερωνα ὡσανει τυπον οντα του Αντιχριστου· και γαρ οὑτος εβουλετο νομιζεσθαι Θεος· and that Antichrist was to be αντιθεος τις; overthrowing indeed the worship of idols and other gods, but only so as to enforce the worship of himself in the place of them and of God.—The apostasy Chrysostom identifies pretty much with Antichrist himself; ὡς πολλους μελλοντα απολλυναι και αφιστᾶν. He adds that, as Rome succeeded Greece, so Rome would be succeeded by Antichrist, and Antichrist by Christ.
Jerome, ordained Presbyter A.D. 378, has again the same:
On Dan. 2. he expounds the gold, silver, brass, and iron of the symbolic Image to be the same four kingdoms as the other fathers: the stone cut out of the mountain without hands being Christ born of a virgin; whose kingdom, upon the destruction of all the other kingdoms, was finally to fill the whole earth. The breaking of the iron legs into ten toes,—part iron, part clay,—he explained of the weakness of the Roman empire at the time he wrote,—about A.D. 407....—On Dan. 7. he explains the four Beasts of the same four empires; the four heads of the third or Macedonian Beast indicating its subdivisions, on Alexander’s death, into the kingdoms of Ptolemy, Seleucus, Philip, Antigonus. On the divisions of the fourth, or Roman...—adding that this eleventh king is to be a man, with Satan’s spirit indwelling, the same as St. Paul’s man of sin: also that the Roman empire is to be finally destroyed on account of this Antichrist’s blasphemies, and with it all earthly kingdoms
Augustine notices and agrees in Jerome’s view of Daniel’s, four Beasts
As to the identity of the fourth Beast’s little horn with St. Paul’s man of sin and St. John’s Antichrist.’ He explains the apostasy in 2 Thess. 2 of a religious apostasy; indeed, (expounding the abstract of the concrete,) as the apostate Antichrist himself; “Nisi venerit refuga primùm, utique a Domino Deo:”—also as to the temple he would sit in, that it seemed to him dubious whether it might mean. Solomon’s ruined temple, or the Christian Church: that at any rate it could not be an idol’s or dæmon’s temple; because that would not be called God’s temple:—further that the let, or hindrance, in Antichrist’s way might not absurdly be taken to mean the Roman empire.
So we see that the church fathers while experiencing persecutions in Rome observed these prophecies with serious expectation that some new Roman power would rise within the churches themselves, claiming to be in some sense equal to Christ in authority over all the churches, ushering in a widespread apostasy and persecution if true believers. It is from this ancient belief that later generations came to consider that the papacy in its previous military and religious power was that 'horn' with religious oversight represented as 'eyes' and speaking 'blasphemous things' such as the Pope's claim as being Christ's vice-regent on earth and insinuating fake authority over all believers.
It is rare a major biblical doctrine is to be entirely absent in the first few hundred years of Christianity and it should be of no surprise that this also has it roots there.