Ubi periculum was a document promulgated by Pope Gregory X during the Second Council of Lyon in 1274 that established the papal conclave as the method of selection for a pope. The conclave formalized the tactics that had been adopted by the magistrates of Viterbo against the cardinals in the protracted papal election, 1268-1271, which had produced Gregory X.
Historians have suggested that Gregory X's status as a non-cardinal prior to his election caused him to adopt such a policy that de-emphasized the interests of the College of Cardinals. The goal of Ubi periculum was to limit strategic maneuvering within papal elections to produce faster outcomes, thereby reducing the number of schisms and disputed elections.
The new election rules limited each cardinal to two servants, prevented them from leaving or communicating with the outside world, and restricted the menu progressively on the fourth and ninth days; these rules were frequently bend and sometimes broken entirely in the ensuing conclaves of the next centuries.
Although the first election following Ubi periculum observed its rules and took only one day, its application was suspended and long drawn out elections characterized the elections in 1277, 1281, 1288, and 1292-1294, until Pope Celestine V (another non-cardinal and relative outsider) reinstituted the law of the conclave.