Papal infallibility
Papal infallibility is a dogma of the Catholic Church which states that, in virtue of the promise of Jesus to Peter, the Pope when he speaks ex cathedra is preserved from the possibility of error on doctrine "initially given to the apostolic Church and handed down in Scripture and tradition".[1] It does not mean that the pope cannot sin or otherwise err in some capacity, though he is prevented by the assistance of the Holy Spirit from issuing heretical teaching even in his non-infallible Magisterium, as a corollary of indefectibility.[2] This doctrine, defined dogmatically at the First Vatican Council of 1869–1870 in the document Pastor aeternus, is claimed to have existed in medieval theology and to have been the majority opinion at the time of the Counter-Reformation.[3]
https://en.m.wikipedia.org/wiki/Papal_infallibility