Eric was appointed to the Carolingian Duchy of Friuli in 789, about two years after the death of the previous duke, Marcarius.
Charlemagne left the campaigning to deal with a Saxon revolt in 792, while Pepin and Eric continued to assault the Avars' ring-shaped strongholds.
The great Ring of the Avars, their capital fortress, was taken twice, and the booty was sent to Charlemagne in Aachen and redistributed to all his followers and even to foreign rulers, including King Offa of Mercia.
The site of Eric's battle, Tarheste or Tarsatica in Latin, has been traditionally identified with Trsat, a hill fort whose ruins today overlook the city of Rijeka.
However, it is more likely that the Tharsatica of Einhard's account was the civitas (Latin for "city") Tergeste on the Adriatic coast beneath the Dinaric Alps, which today would be Trieste inhabited by Slavs at the time.