He was present at the Easter synod of Pope Leo IX in 1949, in which Leo soundly condemned simony and the "wasteful" marriage of priests. Gebhard was respected by, and present for the meetings of, both the pope and the emperor. In fact, he was possibly the most respected advisor to Henry III. When Henry was sending part of the army to aid Pope Leo IX in his trouble with Normans, it was recalled on Gebhard's advice (Gebhard, when pope himself, regretted this decision).
When Leo died in April 1054, a Roman legation came to Henry, requesting that Gebhard be made pope. Gebhard initially resisted, but finally agreed on the condition that the emperor restore to the papacy the properties that had been taken from it by the emperor. Henry agreed—since Gebhard was a pope he could trust—and Gebhard became Pope Victor II on 13 April 1055.
Pope Victor ruled only two years, but his close connection with the emperor made him an enormously powerful pope. In June of 1055 he reaffirmed Leo's condemnations of simony and clerical marriage, and deposed several bishops who had previously resisted correction. Victor threatened to excommunicate King Ferdinand of Spain if he did not recognize Henry as Holy Roman Emperor; Ferdinand relented. Henry repaid him by giving to the pope the duchies of Spoleto and Camerino.
Victor was with Henry when he died, on 5 October 1056, and accepted from Henry the regency for Henry's young son, the six-year-old Henry IV (who might have saved himself some trouble had he grown up and stayed on the good side of the papacy). Victor had the opportunity to rule the Holy Roman Empire as regent for the child emperor!
Alas, he wasn't able to guide the young heir to power or himself to greater power. He died himself on 28 July 1057. While attendants carried his body back to Eichstätt for burial (although pope, he had never given up the bishopric of Eichstätt), zealous Italians snatched the remains and had them buried Ravenna.