In the West, the separation of church and state during the medieval period went through a number of developments, roughly from the end of the Roman Empire through to the beginning of the Reformation. The events of the struggles for power between kings and popes shaped the western world.
For centuries, monarchs ruled by the idea of divine right, which said the king ruled both Crown and Church, a theory known as caesaropapism. On the other side was the belief that the Pope, as vicar of God on earth, should have the ultimate authority over the state.
After the fall of the Roman Empire in the 5th century, there emerged no single powerful secular government in the West, but there was a central ecclesiastical power in Rome, the Christian Church. In this power vacuum, the Church rose to become the dominant power in the West. As the Church expanded beginning in the 10th century, and as secular kingdoms rose in power at the same time, there naturally arose the conditions for a power struggle between Church and Kingdom over ultimate authority.
Main article: Investiture controversy
When the Holy Roman Empire developed as a force in the 12th century it was the first real non-barbarian challenge to the authority of the Church, and a dispute between the secular and ecclesiastical powers emerged known as the Investiture Controversy. While on the surface it was over a matter of official procedures regarding the appointments of offices, underneath was a powerful struggle for control over who held ultimate authority, the King or the Pope. Frederick II's struggle with Pope Innocent III would tear apart the German Empire, the oldest and largest in Europe, a condition from which it would not recover until the 19th century.
Main article: Magna Carta
In England, the principal of separation of church and state can be found in the Magna Carta. The first clause declared that the Church of England would be free from interference by the Crown. This reflected an ongoing dispute King John was having with the Pope over Stephen Langton's election as archbishop of Canterbury, the result of which England had been under interdict for 7 years. The barons, who forced King John to sign the Magna Carta, wanted to create a separation between church and state powers to keep the Crown from using the Church as a political weapon and from arbitrarily seizing its lands and property. However, the Pope annulled the "shameful and demeaning agreement, forced upon the king by violence and fear" one month after it was signed. Nevertheless, the Magna Carta was reissued in 1216 and 1225.
Philip the Fair
Pope Boniface VIII put forward some of the strongest claims to temporal as well as spiritual supremacy of any Pope and meddled incessantly in foreign affairs. He proclaimed that it "is necessary for salvation that every living creature be under submission to the Roman pontiff", pushing Papal Supremacy to its historical extreme. Boniface's quarrel with Philip the Fair became so resentful that he excommunicated him in 1303. However, before the Pope could lay France under an interdict, Boniface was seized by Philip. Although he was released from capitivity after three days, he died of shock a month later. No subsequent popes were to repeat Boniface VIII's claims.
Struggle for power between Thomas Becket and Henry II.
Guelphs and Ghibellines
The conflict between the Guelphs and Ghibellines began as part of the secular-papal struggle.
There was some uncertainty about what would happen to Jerusalem after it was conquered in 1099. Godfrey of Bouillon refused to take the title "king", and was instead called "Defender of the Holy Sepulchre". The Archbishop of Pisa, Dagobert, was named Patriarch in 1100, and attempted to turn the new state into a theocracy, with a secular state to be created elsewhere, perhaps in Cairo. Godfrey soon died however, and was succeeded by his brother Baldwin, who did not hesitate to call himself king and actively opposed Dagobert's plans. By Dagobert's death in 1107, Jerusalem was a secular kingdom.