Benedict soon attempted to regain his office, and in 1045 three popes were struggling for the tiara in the midst of scandal and anarchy. The streets and neighbourhood of Rome swarmed with thieves and assassins; pilgrims were plundered; citizens trembled for their lives, ancl petty barons threatened the rival popes, who were obliged to defend themselves by force. This state of things lasted until Henry III. came to re-establish order. He summoned a synod which deposed the three popes, and then, with the con sent of the Romans, assuming the right of election, proposed a German, Clement II., who was consecrated at Christmas 1046. Henry III. was then crowned, and also took the title of patrician. Henry III. procured the election of four German popes in suc cession. But the fourth German pope, Victor II., died in 1057, and Henry III. had been succeeded in 1056 by the young Henry IV. under the regency of a weak woman, the empress Agnes. The nobles by violence and bribery brought about the election of Benedict X. The cardinals were opposed to him and, fleeing from the city, elected Nicholas II. (1059-61). This pope could only enter Rome when escorted by the troops of Godfrey of Tuscany. When Nicholas died the nobles, assisted by some Lombard bishops, elected Honorius II. and sought aid from the German king, while the cardinals chose Alexander II. (1061-73). Although supported by an armed force of Normans, the latter had to fight-his way into Rome, whither Honorius II. soon followed and won a battle against the forces of Alexander II. with much slaughter. Both candidates were compelled to withdraw from the city until their claims were settled by the German court. Strife continued, but Alexander II. finally was recognized as pope and attempted to reform the church, though he had little power in the city.
At Alexander's funeral Hildebrand was seized by the crowd and acclaimed as pope. The cardinals who were i favourable to him, hastened to go through the form of an election in order to give a legal warrant to what had been done by popular violence ; he chose the name of Gregory VII. (1073-85) and secured recognition from Henry IV. Gregory confirmed his predecessor's decrees against simoniacal and non-celibate priests and forbade the clergy to receive investiture at the hands of laymen. As the high ecclesiastical dignitaries held much territory and were also high officials of the empire, this decree was certain to cause a fierce contest between the emperor and the pope. Some of the nobles had already shown their hostility to Gregory; at Christmas 1075 the prefect Cencius and other nobles seized Gregory while he was celebrating mass in Santa Maria Maggiore and dragged him away to imprisonment. The people were incensed at this outrage and fear of popular wrath compelled Cencius to release Gregory. About the same time Henry IV., exasperated by a letter in which Gregory had sharply rebuked him for his sins, declared Gregory deposed from the papacy, and Gregory in turn decreed the ex communication and deposition of the emperor. That monarch afterwards made submission to Gregory at Canossa (1077), then again turned against him and was again excommunicated. In 1081, with his anti-pope Clement III., he besieged Rome in vain. He was equally unsuccessful in each of the two following years, but at last forced his way into the city (March 1084) and com pelled Gregory to seek refuge in the castle of St. Angelo. The emperor, as master of Rome, procured the consecration of Clement III., by whom he was crowned in turn. He then attacked and seized the capitol and assaulted the castle of St. Angelo in the hope of capturing the pope. But Robert Guiscard brought his Norman army to the rescue. Emperor and anti-pope fled; the city was taken, the pope liberated, and Rome was brutally sacked for three days by the Normans. After this Gregory, broken with grief and hated by the Romans, had to go away with the Normans and died at Salerno on May 25,1085.