Having been under Avar control, lower Pannonia became a march of the Carolingian Empire around 800. Aided by Vojnomir in 796, the first named Slavic Duke of Pannonia, the Franks wrested control of the region from the Avars before totally destroying the Avar realm in 803. After the death of Charlemagne in 814, Frankish influence decreased on the region, allowing Prince Ljudevit Posavski to raise a rebellion in 819. The Frankish margraves sent armies in 820, 821 and 822, but each time they failed to crush the rebels. Aided by Borna the Guduscan, the Franks eventually defeated Ljudevit, who withdrew his forces to the Serbs and conquered them, according to the Frankish Annals.