On September 23, 1122, an agreement was reached at Worms between the representatives of Pope Callixtus II and the Emperor Henry V, ending the Investiture Controversy. Bishops in Germany and Burgundy were to be elected by the clergy of their churches, with the emperor present and able to decide a disputed election. They would be invested with the ring and the staff, the symbols of their office, by the church, and with their lands and rights by the emperor, through a touch of the sceptre.
The dispute ran since 1075. The question, put plainly, was who put a bishop in office. A bishop in the German kingdom was not only a priest: he was a territorial ruler, with courts, soldiers, tolls and a vote, and the Ottonian and Salian kings had built their government on the bishops rather than on the dukes. When the reformed papacy, under Gregory VII, declared that a bishop appointed by a layman was no bishop and that he was deposed, it was attacking the basis of the king's power.
The results were extraordinary. In 1076 Gregory excommunicated Henry IV and released his subjects from their oaths, and in January 1077 Henry stood in the snow at Canossa for three days to get the sentence lifted. It did not end there: the German princes elected a rival king, Henry's son rebelled, and in 1080 Gregory declared Henry deposed again. Henry took Rome with an army in 1084 and Gregory died in exile in Salerno in 1085.
What settled it was exhaustion and a change of tactics on both sides. The reformers had taken to distinguishing the spiritual office from the temporal property, and that distinction is what the concordat used: the ring and the staff belong to the church, the lands and regalia to the king. Henry V, who had fought the same war as his father and had got himself excommunicated for it, needed peace with the German princes. Callixtus, who had spent his pontificate without access to Rome, needed to be recognised.
Neither side won. The emperor lost the right to appoint bishops outright and kept a decisive say in who got elected, which turned out to be worth more over time. The papacy established that spiritual office could not be given by a layman, and the principle stuck. The conflict continued in other forms: Frederick Barbarossa fought an antipope, and the Hohenstaufen and the papacy exhausted each other in Italy.
It was ratified at the First Lateran Council in 1123, and it is one of the documents that made the idea of a boundary between church and state thinkable in Europe. The German church kept its temporal power until the secularisations of 1803.