Adrian and his predecessors had to contend with periodic attempts by the Lombards to expand their holdings in Italy at the expense of the papacy. Not receiving any support from Constantinople, the popes looked for help to the Franks. Adrian's tenure saw the culmination of on-going territorial disputes between Charlemagne and his brother Carloman. The Lombard king Desiderius supported the claims of Carloman's sons to their late father's land, and requested Pope Adrian crown Carloman's sons "Kings of the Frank". When the Pope failed to do so, Desiderius invaded Papal territory and seized the Duchy of the Pentapolis. Charlemagne besieged Pavia and took the Lombard crown for himself. He then restored the Pentapolis to the Papacy as well as some of the captured Lombard territory.
Shortly after Adrian's accession in 772, the territory ruled by the papacy was invaded by Desiderius, king of the Lombards, and Adrian was compelled to seek the assistance of the Frankish king Charlemagne, who entered Italy with a large army. Charlemagne besieged Desiderius in his capital of Pavia. After taking the town, he banished the Lombard king to the Abbey of Corbie in France, and adopted the title "King of the Lombards" himself. The pope, whose expectations had been aroused, had to content himself with some additions to the Duchy of Rome, the Exarchate of Ravenna, and the Pentapolis in the Marches, which consisted of the "five cities" on the Adriatic coast from Rimini to Ancona with the coastal plain as far as the mountains. He celebrated the occasion by striking the earliest papal coin, and in a mark of the direction the mediaeval papacy was to take, no longer dated his documents by the Emperor in the east, but by the reign of Charles, king of the Franks.
A mark of such newly settled conditions in the Duchy of Rome is the Domusculta Capracorum, the central Roman villa that Adrian assembled from a nucleus of his inherited estates and acquisitions from neighbors in the countryside north of Veii. The villa is documented in Liber Pontificalis, but its site was not rediscovered until the 1960s, when excavations revealed the structures on a gently-rounded hill that was only marginally capable of self-defense, but fully self-sufficient for a mixed economy of grains and vineyards, olives, vegetable gardens and piggery with its own grain mill, smithies and tile-kilns. During the 10th century villages were carved out of Adrian's Capracorum estate: Campagnano, mentioned first in 1076; Formello, mentioned in 1027; Mazzano, mentioned in 945; and Stabia (modern Faleria), mentioned in 998.
While the Lombards had always been openly respectful of the papacy, the popes distrusted them. The popes had sought aid from the Eastern Roman Empire to keep them in check. Adrian continued this policy. Because the East could offer no direct aid, Adrian then looked to the Franks to offset the power of the Lombards.
Upon the death of Pepin the Short in 658, his kingdom was left to his sons Charlemagne and Carloman I. Relations between the brothers is said to have been strained. In 770 Tassilo III, Duke of Bavaria married a Lombard princess, Liutperga, daughter of King Desiderius, to confirm the traditional alliance between Lombardy and Bavaria. That same year, Charlemagne concluded a treaty with Duke Tassilo, and married Liutperga's sister, Desiderata, to surround Carloman with his own allies. Less than a year later, Charlemagne repudiated Desiderata and married Hildegard, the daughter of Count Gerold of Kraichgau and his wife Emma, daughter, in turn, of Duke Nebe (Hnabi) of Alemannia. Hildegard's father had extensive possessions in the territory under Carloman's dominion. This marriage was advantageous to Charlemagne because it allowed him to strengthen his position east of the Rhine and also bind the Alemannian nobility to his side. With Desiderata's return to her father's court at Pavia, Desiderius was grievously insulted, and appears to have made an alliance with Carloman against Charlemagne and the Papacy, which looked to the Franks for protection against Lombard incursions into Papal territory..
Carloman died in December 771, and when Charlemagne seized his brother's territory, Carloman's widow, Gerberga, and their two sons fled for refuge to the Lombard court at Pavia. Desiderius made overtures to Pope Adrian, requesting that he acknowledge Carloman's sons' right to succeed their father, and crown them as Kings of the Franks. With Charlemagne occupied with a campaign against the Saxons, Desiderius saw an opportunity to take all of Italy. He invaded the Duchy of the Pentapolis which had been given to the papacy in 756 by Charlemagne's father. Desiderius's support of the claims of Carloman's sons posed a potential challenge to the legitimacy of Charlemagne's possession of his brother's lands. In 773, he cut short a military campaign near Paderborn, crossed the Alps, and laid siege to Pavia. In exchange for their lives, the Lombards surrendered and Desiderius was sent to the abbey of Corbie. Charlemagne assumed the title "King of the Lombards".
Friendly relations between pope and king were not disturbed by the theological dispute about the veneration of icons. In 787, Second Council of Nicaea, approved by Pope Adrian, had confirmed the practice and excommunicated the iconoclasts. Charlemagne, however, who had received the Council's decisions only in a bad Latin translation, consulted with his theologians and sent the Pope the Capitulare contra synodum (792), a response critical of several passages found in the council's acts. He also had his theologians, including Theodulf of Orleans, compose the more comprehensive Libri Carolini. Pope Adrian reacted to the Capitulare with a defense of the Council. In 794, a synod held at Frankfurt in 794 discussed the issue but refused to receive the Libri and content itself with condemning extreme forms of veneration of icons.
In 787 Adrian elevated the English diocese of Lichfield to an archdiocese at the request of the English bishops and King Offa of Mercia to balance the ecclesiastic power in that land between Kent and Mercia. He gave the Lichfield bishop Hygeberht the pallium in 788.
Regarding the Muslims, he maintained the prohibition of Pope Zachary of selling slaves to Muslims, whom Adrian described as "the unspeakable race of Saracens," in order to guarantee a labor pool and to keep the power of Muslim rivals in check. He also encouraged Charlemagne to lead his troops into Spain against the Muslims there and was generally interested in expanding Christian influence and eliminating Muslim control.
An epitaph written by Charlemagne in verse, in which he styles Adrian "father", is still to be seen at the door of the Vatican basilica. Adrian restored some of the ancient aqueducts of Rome and rebuilt the churches of Santa Maria in Cosmedin, decorated by Greek monks fleeing from the iconoclastal persecutions, and of San Marco in Rome. At the time of his death at the age of 95, his was the longest pontificate in Church history until it was surpassed by the 24-year papacy of Pius VI in the late 18th century. Only three other popes – Pius IX, Leo XIII, and John Paul II – have reigned for longer periods since.