The Avars, a nomadic, slavized central Asian people, were situated along what is referred to as the eastern Marches of Bavaria, and where Gerold's military command was to be focused for the entirety of his career as prefect of Bavaria. He was, for instance, described in the
Royal Frankish Annals as "guard of the Avar border". Historians have referred to the Avar War as one of Charlemagne's greatest wars he ever waged. This is due to the zeal and tenacity with which the Franks, and specifically the Bavarian contingent under Gerold, fought. The war with the Avars began after the deposition of Tassilo III, the last Duke of Bavaria, prior to the full takeover of the state by the Franks, in 787. Tassilo was accused of inciting the Avars into a war with the Franks, promising to attack them with his Bavarian soldiers if the Avars would invade. This accusation led to a charge of treason and treachery against the Franks, which culminated in his exile. Despite Tassilo III's deposition, the Avars decided to wage this war all the same. The Avars led two campaigns against the Franks, invading Bavaria, and both times were beaten back by Gerold, who had newly taken command of the army in the eastern Marches of Bavaria, and his Bavarian contingent. As the war dragged on, the Franks successfully raided the Avars in 791, beating them continually in battle, but never decisively. Eventually the 'Rings of the Avars', a collection of grand fortresses that the Avars were famous for having constructed, were breached by collective efforts from Gerold and his Bavarians, Eric of Friuli, and King
Pepin of Italy. The Franks razed the fortresses, plundered them, sending many great riches back to Aachen, Charlemagne's capital, and proceeded to drive the Avars off, considerably weakening their hold in the Avarian marches and western Pannonia, though not breaking the back of their military capabilities completely. This plunder taken from the Avars was to be sent by the Carolingians to many other states, such as that of Mercia, as a show of good faith. The Bavarian troops under Gerold, in combination with Pepin, King of Italy, Charlemagne's son, were later successful in pushing the Avars across the Theiss River, deeper into Pannonia, as the Avars were not inclined to fighting large scale, pitched battles with the Franks, who, with the support, manpower, and arms Charlemagne had collected at Regensburg, were now fully prepared to strike the death-blow at the Avars. In 797 and 799 Charlemagne came to Bavaria, mustering a large force of Franks, Allemans, Bavarians, and soldiers fighting under King Pepin of Italy, at Lorch, where Gerold held his court as prefect. These two campaigns were exceedingly successful in pushing the Avars continually eastwards towards the Danube River. ==Death==