Upon the death of his patron and spiritual model, Teobaldo decided not to remain any longer in the Curia, planning to travel to Paris, where he would study
theology. When he reached Lyons, however, he was received by the Archbishop-elect, Philippe, who asked him to be the
dominus and
magister of the household. Teobaldo initially refused, but the Archbishop insisted and finally Teobaldo accepted the position. In July 1244,
Pope Innocent IV was forced by Frederick II Augustus to flee from Rome. He first travelled to his native Genoa, and then headed to Lyons, where the idea of an ecumenical council took shape. Teobaldo helped to organize the
Ecumenical Council which met at Lyons in June and July 1245. During this period, Visconti became acquainted with people such as
Bonaventure,
Thomas Aquinas,
Gui Foucois,
Pierre de Tarentaise and Matteo Rubeo Orsini, all of whom were participants in the council. Visconti was appointed Archdeacon of Heinault in the diocese of
Liège on 9 September 1246, perhaps as a reward for his services. He was instructed by Pope Innocent IV (Sinibaldo Fieschi, 1243–1254) to preach the crusade for the
recovery of the Holy Land. Such preaching had more of a financial character than one might think, since both Crusaders and Papacy were desperate to raise funds. Teobaldo was not able to do much more than preach, sacerdotally, since he still was not a priest. Teobaldo's time in Liège was evidently not a happy one. The bishop whom he had come to know at the Council of Lyons,
Robert de Thorete, died after a brief illness on 16 October 1246. There had been a struggle for the episcopal seat when he was appointed. The Provost of Utrecht, the candidate of Frederick II, had attempted to usurp the seat, and Cardinal Giacomo de Pecorari, Bishop of Palestrina had been ordered by the Pope to intervene and prohibit an election until the canons of the cathedral could meet with him. But the vacancy of the papal throne occurred after the death of Pope Gregory IX, and lasted until June 1243. In that interval the squabbling electors came to an understanding, and on 30 October 1240, Robert, the brother of the
Bishop of Verdun, was chosen. Another struggle between two candidates ensued on his death, and Cardinal Robert Capocci was sent to settle the election. Since Teobaldo was a canon as well as Archdeacon, he was directly involved. The successful candidate, on 10 October 1247, , was a worldly man, the brother of
Otto II, Count of Guelders, and was not yet in Holy Orders. In fact, for the next twelve years, he was neither ordained priest nor consecrated bishop. The new Bishop-Elect and his Archdeacon immediately had problems about Teobaldo's conduct of his office while being absent in Paris, an issue which was not settled until the end of 1250. Finally, in 1258, Henry of Guelders was consecrated. He also had himself elected Abbot of the famous
Monastery of Stabulo (Stavelo). This did not mean that he gave up his former dissolute military life. In 1262, he clashed with Archdeacon Teobaldo. During a Chapter meeting, he was roundly criticized by Teobaldo, who accused him of compromising the virtue of Berta, daughter of Conrardi de Coen le Frison, by force. The Bishop threatened to strike the Archdeacon. Consequently, few days later, Teobaldo was moved to leave Liège, and it is said that he undertook a pilgrimage to the Holy Land. He actually got as far as Paris, where he resumed his long-standing plan of studying theology. During this time he became a friend of King
Louis IX. Visconti left Liège in 1267 for
Paris at the behest of
Pope Clement IV who sent him to England to assist Cardinal
Ottobono Fieschi, who had been appointed Papal Legate in England in 1265, to support King
Henry III in the
rebellion of the barons, led by
Simon de Montfort. It was during this assignment that Teobaldo became friends with Prince Edward of England (the future
Edward I), with whom he went on Crusade. Cardinal Fieschi returned to Viterbo, and participated in the conclave of 1268–1271. Edward took the cross on 24 June 1268, followed Louis IX
to Tunisia, and finally
reached Acre on 9 May 1271. ==Papal election==