And Jesus answering said to him: "And I say to thee: That thou art Peter; and upon this rock I will build my church, and the gates of hell shall not prevail against it. And I will give to thee the keys of the kingdom of heaven. And whatsoever thou shalt bind upon earth, it shall be bound also in heaven: and whatsoever thou shalt loose on earth, it shall be loosed also in heaven." (Matt. 16:18-19)
THE INFALLIBILITY OF THE POPE: The infernal spirit of lies would overcome the Church, if he could succeed in diverting her from the true faith, and plunging her into error. If, therefore, the Church is to be invincible through Peter (that is, through the Papacy), the Pope must be an infallible teacher. Even as far back as the third century St. Cyprian writes: "To the rock of Peter no error can obtain access."
[From 'A Practical Commentary on Holy Scripture' by Bishop Knecht, D.D.]
(1899 Douay-Rheims Bible)