As recounted by Catholic Encyclopedia (EC) “The cardinals gathered in Viterbo were divided into two camps, the French and the Italian. Neither of them could obtain two-thirds of the majority of the vote nor did they want to give in to the others to elect a candidate to the papacy.”
“At last a compromise was reached through the redoubled efforts of the kings of Sicily and France. The sacred College, which then consisted of 15 cardinals, appointed six to agree and cast a final vote,” recalls the EC.
Thus, the six cardinals “met on September 1, 1271 and united their votes by electing Teobaldo Visconti, archdeacon of Liège who was not a cardinal, nor even a priest.” When he was elected he was with Prince Edward of England, on a pilgrimage to the Holy Land.