Charlemagne became King of the Lombards in 774, after conquering the Lombard kingdom in northern Italy. The Lombard king Desiderius surrendered at Pavia in June 774, and Charlemagne then adopted the Lombard royal title.
The conflict grew from Charlemagne’s alliance with Pope Adrian I. When Desiderius threatened papal territories, Charlemagne crossed the Alps and besieged Pavia. The victory ended the independent Lombard kingdom, though Lombard institutions and elites continued under Frankish rule.
A common mix-up is with 768, when Charlemagne became King of the Franks, and 800, when Pope Leo III crowned him emperor. The year 781 is also associated with his son Pepin’s installation as King of Italy, a separate event from Charlemagne’s own Lombard kingship.