The relationship between Charlemagne and Pope Leo ||| marked a high point in pope-ruler cooperation. Charlemagne was a devout Christian and viewed his victories as proof God's blessing. He wanted to improve the Church, rule in a Christian manner, and become emperor to have a special relationship with God.
These are my rules as pope...
The Pope left Rome after rival threats to Charlemagne's court. After Charlemagne enforced his safety, they supported each other. The Pope crowned Charlemagne emperor on Christmas day during his visit to Rome. This proved to be a controversial action later.
You are my new bishop.
This action led to lasting effects on Europe, one being the strengthening of the Western European Church, the other weakening the Eastern European church. Also, conflict was arising between pope and king after Charlemagne's coronation because they both had different views on the coronation's meaning and purpose. Charlemagne thought that God made him emperor in order to do His work on Earth and that the Church should assist him, but the pope thought that it was the duty of the king to assist the church in doing God's work.
Do you give up your position as pope?
In around 1073, Pope Gregory V|| came into the position of pope with king Henry |V in rule. Pope Gregory issued a set of rules, including that he had authority over Church and secular rulers, had the power to choose bishops, and even that he had the power to remove emperors from throne.
As one would expect, Henry was infuriated at the challenge to his power. Henry started the conflict when he ignored the Pope and his rules and selected a new bishop. Gregory hired a rival bishop. Henry then tried to remove Gregory as pope, which was responded by Henry's excommunication, or excluding from the religious community, by the pope.
Even after forgiveness, the conflict remained and, eventually, Henry forced the pope from office by marching a large army to Rome. The power struggle continued for decades until an agreement, called the Concordat of Worms, was founded. The Church was given full power to appoint bishops, but the king was allowed to give pieces of land to bishops to win their loyalty. Even after the agreement, popes and rulers still had their conflicts.