Note that the previous Pope named John was Pope John XIX and there is no Pope John XX.
Pedro Julião, born between 1210 and 1220, was probably born in Lisbon. He started his studies at the Episcopal school of Lisbon Cathedral, and later entered University of Paris, although some historians claim that he was educated at Montpellier. Wherever he studied, he concentrated on medicine, theology, and Aristotle's dialectic, logic, physics and metaphysics.
From 1245 to 1250 he became known as Pedro Hispano (because he came from the Iberian Peninsula, known as Hispania) and taught medicine at the university of Siena, where he wrote the Summulae Logicales, a reference manual on Aristotelian logic in use in European universities for more than 300 years. He became famous as a university teacher, then returned to Lisbon. In the courts of Guimarães he was the councilor and spokesman of the king Alfonso III of Portugal in church matters; later, becoming prior of Guimarães. He tried to become Bishop of Lisbon, but he was defeated, a personal failure, but became the master of the school of Lisbon.
Pedro became the physician of Pope Gregory X.
After the death of Pope Adrian V, on August 18, 1276, Pedro Hispano was elected Pope at the conclave of cardinals on September 13, and he was crowned a week later. One of John's few acts during his brief rule was to reverse the decree passed at the Second Council of Lyons, which confined cardinals in solitude until they elected a successor Pope.
The Pope added a new wing to his palace at Viterbo; it was poorly built, and while he lay sleeping part of the roof fell in and he was seriously injured. He died eight days later, on May 20, 1277 and was buried there. He only ruled for about eight months. He tried to make a crusade for the Holy Land and unite the Eastern and Western churches, attempting to maintain peace between the Christian nations. His tomb is in Viterbo Cathedral.