The papal election from November 1268 to September 1, 1271, following the death of Pope Clement IV, was the longest papal election in the history of the Catholic Church. This was due primarily to political infighting between the cardinals. The election of Teobaldo Visconti as Pope Gregory X was the first example of a papal election by "Compromise." The election was effected by a Committee of six cardinals agreed to by the other remaining ten. The election occurred more than a year after the magistrates of Viterbo locked the cardinals in, reduced their rations to bread and water, and legendarily removed the roof of the Palazzo dei Papi di Viterbo.
As a result of the length of the election, during which three of the twenty cardinal-electors died and one resigned, Gregory X promulgated the apostolic constitution Ubi periculum on July 7 (or 16), 1274, during the Second Council of Lyon, establishing the papal conclave, whose rules were based on the tactics employed against the cardinals in Viterbo. The election itself is sometimes viewed as the first conclave.
The dynamic of the conclave was divided between the French Angevin cardinals, mostly created by Pope Urban IV, who were amenable to an invasion of Italy by Charles of Anjou, and the non-French (mostly Italian) cardinals whose numbers were just sufficient to prevent a French pope from being elected. Clement IV's crowning of Charles of Anjou as King of Naples and Sicily, previously a papal fief, had cemented the influence of the French monarchy in the Italian peninsula and created an intense division within the College of Cardinals between those who opposed and supported French influence, and by extension, ultramontanism.Conradin, the last ruler of the House of Hohenstaufen, had been beheaded in Naples just a month before the death of Clement IV.