Giovanni was named Cardinal Bishop of Velletri by Pope Leo IX in 1050. He was highly esteemed, however, by those who wanted to reform the Church, and was one of five men proposed by Cardinal Frederick of Lorraine when consulted during the summer of 1057 concerning a possible successor to Pope Victor II, whom Frederick himself succeeded as Pope Stephen IX.
Upon Pope Stephen's death the following year, Giovanni was elected pope on 4 April 1058, his election having been arranged by his family. This was in violation, however, of a decree by the late pope that no election was to be held until the return of Cardinal Hildebrand from a mission to Germany. Hildebrand (later Pope Gregory VII) had been sent by the late Pope Stephen to the court of Empress Agnes (mother and regent for Emperor Henry IV, then a minor), who had questioned the validity of Stephen's own election. As a result, a number of cardinals alleged that the election was irregular. These cardinals were soon forced to flee Rome.
When Hildebrand heard of Benedict's election during his return journey to Rome, he decided to oppose it. He went to Florence where he obtained the support of the Duke of Lorraine and Tuscany for the election of Gerhard of Burgundy, Archbishop of Florence, as pope instead. Support for this was given by Empress Agnes. Those cardinals who had opposed Benedict's election met at Siena in December 1058, and elected Gerhard, who then took the name of Nicholas II.
Nicholas then proceeded towards Rome, along the way holding a synod at Sutri, where he pronounced Benedict deposed and excommunicated. The supporters of Nicholas then gained control of Rome, and forced Benedict to flee to the castle of Count Gerard of Galeria. Having arrived in Rome, Nicholas was crowned as pope on 24 January 1059. He then proceeded to wage war against Benedict and his supporters, with the assistance of Norman forces based in southern Italy, after he agreed to recognize Count Richard of Aversa as ruler of Capua. An initial battle was fought in Campagna in early 1059, which was not wholly successful for Nicholas; but later that same year, his forces conquered Praeneste, Tusculum and Numentanum, and then attacked Galéria, forcing Benedict to surrender and to renounce the papacy in the Fall of that year.
Benedict was allowed to go free, and he retired to one of his family's estates in the city. Pope Nicholas, however, deemed his submission inadequate and had him publicly tried in 1060, with Hildebrand serving as his prosecutor. Despite pleading that he had been forced to assume the papal crown, he was convicted that April and stripped of all his titles. He was further sentenced to confinement in the hospital attached to the Basilica of Sant'Agnese fuori le mura, where he died, still a prisoner, sometime between 1073 and 1080. He was likely buried in the adjoining church.
The most important consequence of these events was the adoption of new regulations for papal elections, laid out at a synod called by Pope Nicholas in the Lateran Palace on Easter 1059. These took away the role of the Roman citizenry in the election of future popes, limiting the vote to the College of Cardinals. Additionally, the ancient title which Benedict had held of Bishop of Velletri was combined with the see of the Bishop of Ostia. (Ostia and Velletri would be separated in 1914.)