It continued to act as the administrative center of the kingdom , but by the reign of Desiderius , it had fallen to a first-rate defensive work and Charlemagne took it in the Siege of Pavia ( June , 774 ) assuming the kingship of the Lombards . It continued to function as the administrative center of the kingdom , but by the reign of Desiderius , it had deteriorated as a first-rate defensive work and Charlemagne took it in the Siege of Pavia ( June , 774 ) assuming the kingship of the Lombards .