With the reign of Constantine I, the Bishop of Rome gained political as well as religious importance, eventually becoming known as the Pope and establishing Rome as the center of the Catholic Church. After the Sack of Rome in AD 410 by Alaric I and the fall of the Western Roman Empire in AD 476, Rome alternated between Byzantine and plundering by Germanic barbarians. Its population declined to a mere 20,000 during the Early Middle Ages, reducing the sprawling city to groups of inhabited buildings interspersed among large areas of ruins and vegetation. Rome remained nominally part of the Byzantine Empire rule until AD 751 when the Lombards finally abolished the Exarchate of Ravenna. In 756, Pepin the Short gave the pope temporal jurisdiction over Rome and surrounding areas, thus creating the Papal States.
Rome remained the capital of the Papal States until its annexation into the Kingdom of Italy in 1870; the city became a major pilgrimage site during the Middle Ages and the focus of struggles between the Papacy and the Holy Roman Empire starting with Charlemagne, who was crowned its first emperor in Rome on Christmas 800 AD by Pope Leo III. Apart from brief periods as an independent city during the Middle Ages, Rome kept its status of Papal capital and "holy city" for centuries, even when the Pope briefly relocated to Avignon (1309–1337). While no longer politically powerful, as tragically shown by the brutal sack of 1527, the city flourished as a hub of cultural and artistic activity during the Renaissance and the Baroque, under the patronage of the Papal court.