The Holy Roman Empire was a political entity centered in Germany from 962 to 1806 CE that controlled a large part of Europe after the fall of the Western Roman Empire. Key events included Charlemagne being crowned Holy Roman Emperor by the Pope in 800 CE, the establishment of the Carolingian Empire, and the investiture controversy between Pope Gregory VII and Emperor Henry IV over who had authority to appoint bishops. This controversy was eventually settled by the Concordat of Worms. The Thirty Years War between Protestant and Catholic states, and the Peace of Westphalia which ended the war, contributed to the decline of the fragmented Holy Roman Empire.