Pope Innocent died on 30June 1276. After the cardinals assembled in the Lateran Palace, Charles' troops surrounded it, enabling only his allies to communicate with other cardinals and with outsiders. On 11July the cardinals elected Charles' old friend, Ottobuono de' Fieschi, pope, but he died on 18August. The cardinals met again, this time at Viterbo. Although Charles was staying in the nearby Vetralla, he could not directly influence the election, because his vehement opponent, Cardinal Giovanni Gaetano Orsini, dominated the papal conclave. Pope John XXI, who was elected on 20September, excommunicated Charles' opponents in Piedmont and prohibited Rudolf from coming to Lombardy, but did not forbid the Lombardian Guelph leaders swearing fealty to Rudolf. The Pope also confirmed the treaty concluded by Charles and Maria of Antioch on 18March which transferred her claims to Jerusalem to Charles for 1,000 bezants and a pension of 4,000 .