Concordat of Worms
In 1122, Pope Calixtus II and Roman Emperor Henry V agreed to put an end to the struggle over investiture. (The dispute over clerical investiture between the church and state in the Middle Ages.) The emperor guaranteed free election of bishops and abbots and renounced the right to invest them with ring and staff, the symbols of their spiritual duties. The pope granted Henry the right from Germany, to be present at elections and to invest people that are elected with their lay rights and obligations before their consecration. The compromise between spiritual and temporal power that this concordat achieved remained the basis of subsequent relations between Holy Roman Emperors and the Pope. So this helped with the decline in the Middle Ages.