Pope Clement V died a few months before Philip (April, 1314), and was succeeded by John XXII, a Frenchman, who was seventy years old at the time of his election, and lived to ninety. The most remarkable thing in John's papacy was his quarrel with Lewis of Bavaria, who had been chosen emperor by some of the electors, while others voted for Frederick of Austria. For the choice of an emperor (or rather of a king of the Romans) had by this time fallen into the hands of seven German princes, of whom four were laymen and three were the archbishops of Mentz, Cologne, and Treves. And hence it is that at a later time we find that some German princes had "elector" for their title, as the Electors of Hanover and the Electors of Brandenburg; and even that the three clerical electors were more commonly called electors than archbishops. It is not exactly known when this way of choosing the kings of the Romans came in; but, as I have said, it was quite settled before the time of which we are now speaking.
There was, then, a disputed election between Lewis of Bavaria and Frederick of Austria, and Pope John was well pleased to stand by and watch their quarrel, so long as they only weakened each other without coming to any settlement of the question. But when Lewis had got the better of Frederick, then John stepped in and told him that it was for the pope to judge in such a case which of the two ought to be king of the Romans. And he forbade all people to obey Lewis as king, and declared that whatever he might have done as king should be of no effect. But people had become used to such sentences, so that they would not mind them unless they thought them just; and thus Pope John's thunder was very little heeded. Although he excommunicated Lewis, the sentence had no effect, and by this and other things (especially a quarrel which John had with a part of the Franciscan order), people were set on inquiring into the rights of the papacy in a way which was quite new, so that their thoughts took a direction which was very dangerous to the power of the popes.
Lewis answered the pope by setting up an antipope against him. But this was a thing which had never succeeded; and so it was that John's rival was obliged to submit, and, in token of the humblest repentance, appeared with a rope round his neck at Avignon, where the rest of his life was spent in confinement.
The pope on his part set up a rival emperor, Charles of Moravia, son of that blind King John of Bohemia whose death at the battle of Cressy is known to us from the history of England. But Charles found little support in Germany so long as Lewis was alive.
The next pope, Benedict XII (AD 1334-1342), although of himself he would have wished to make peace with Lewis, found himself prevented from doing so by the king of France, and his successor, Clement VI. (AD 1342-1352), who had once been tutor to Charles of Moravia, strongly supported his old pupil. Lewis died excommunicate in 1347, and was the last emperor who had to bear that sentence. But, although he suffered much on account of it, he had yet kept his title of emperor as long as he lived; and he left a strong party of supporters, who were able to make good terms for themselves before Charles was allowed to take peaceable possession of the empire.