Siege of Trsat The Siege of Trsat ( ) was a battle fought over possession of the town of Trsat ( ) in Liburnia , near the Croatian – Frankish border . The battle was fought in the autumn of 799 between the defending forces of the Dalmatian Croatia under the leadership of Croatian duke Višeslav and the invading Frankish army of the Carolingian Empire led by Eric of Friuli . The battle was a Croatian victory , and the Frankish commander Eric was killed during the siege . The Frankish invasion of Croatia , the destruction of Tarsatica , the coronation of Charlemagne as Holy Roman Emperor , and negotiations from 802 – 815 between the Franks and Byzantines led to a stalemate . The Dalmatian Croatia consequently peacefully accepted a limited Frankish overlordship . Background . Charlemagne , King of the Franks from 768 until his death in 814 , expanded the Frankish kingdom into an empire that incorporated much of western and central Europe . He brought the Frankish state face to face with the Slavs to the northeast and the Avars and Slavs to the southeast of the Frankish empire . The Croats lived in Pannonian Croatia and Dalmatian Croatia ( Littoral Croatia ) to the southeast of the Frankish Empire . Dalmatian Croatia was ruled by Duke Višeslav , one of the first known Croatian dukes . While fighting the Avars , the Franks called for Slavic - Croatian support . Croatian Prince Vojnomir of Pannonian Croatia launched a joint counterattack with the help of Frankish troops under Charlemagne in 791 . The offensive was successful and the Avars were driven out of Croatia . In return for the help of Charlemagne , Vojnomir was obliged to recognize Frankish sovereignty , convert to Christianity , and have his territory named Pannonian Croatia . Charlemagne again campaigned against the Avars and won a major victory in 796 . Prince Vojnomir aided him , and the Franks became overlords of the Croatians of northern Dalmatia , Slavonia , and Pannonia . The Franks placed Pannonian Croats under Eric , the margrave of Friuli , who then tried to extend his rule over the Croatians of Dalmatia . The conquest of Istria by the Franks brought the realm of Charlemagne adjacent to Dalmatia . Dalmatia at that time included both Roman cities and a Slavic - Croatian hinterland that was loosely subject to the rule of the Byzantine Empire . In the treaty of 798 , the Franks acknowledged Byzantine rights over the Slavs , but in the following years both Croatian Župans ( dukes ) and Roman communities recognized an opportunity to win full independence from both Imperial powers . As the eldest son of Gerold of Vinzgouw and as a high ranking Frankish commander , Eric was titled from 789 to his death the Duke of Friuli ( " dux Foroiulensis " ) . He was appointed governor of Istria , Fruli , and neighbouring areas by Charlemagne . Eric wanted to extend his dominion by conquering Dalmatian Croatia . In the autumn of 799 , Eric marched from Istria along the seacoast of Liburnia towards the town of Trsat , which is today part of the city of Rijeka . Meanwhile his opponent , duke Višeslav , gathered his forces and moved north from his governing center at Nin . Siege . Upon arriving at the foot of the settlement , Eric besieged and attacked the city , but was repelled . Led by duke Višeslav , the inhabitants of Trsat threw spears , shot arrows , and hurled huge stones on the enemy , and managed to kill many of them . Eric ' s forces fled their positions , and were subsequently routed by the forces of Višeslav in an ambush . Eric was among those killed , and his death and defeat proved to be a great blow for the Carolingian Empire . Aquileia n Patriarch Saint Paulinus II cursed the land in which the hero was killed , and wrote " Carmen de regula fidei " , the rhythmus or elegy for his death . According to contemporary Frankish scholar and courtier Einhard , Eric was killed at Trsat ( Tarsatch ) , a town on the coast of Liburnia by the treachery of the inhabitants . Due to a lack of primary materials , it is uncertain who killed Duke Eric . Most of historians point at Croats , while some point at Byzantines . Einhard also notes the death of Gerold , Prefect of Bavaria , another Frankish commander who was slain in Pannonia in the same year . Croatian historian Nenad Labus refers to this event as a successful assassination attempt by Avars and Slavs . Historian Pierre Riché believes that Dalmatian Croats ( Guduscani ) killed Eric in collusion with Avars . Besides the Royal Frankish Annals ( " Annales Regni Francorum " ) , there is another primary source compiled in c . 950 , the historical work " De administrando imperio " , ascribed to Constantine Porphyrogenitus , which refers to Croatian - Frankish relations . Constantine notes that for a number of years the Croats of Dalmatia were subjects of the Franks , who treated them brutally . The Croats revolted and slew their princes . In an act of revenge , a large army from Francia invaded Croatia . After seven years of war , the Croats managed to defeat the Franks , killing a large portion of the invading army along with its commander . Although Constantine describes a chain of events that are analogous to the ' Siege of Trsat ' , he does not mention Tarsatica or the exact year of these events . Aftermath . In 800 , Eric ' s successor Cadolah of Friuli invaded the Dalmatian Croatia by the order of Charlemagne , but without considerable military success . Still , Tarsatica was burned down . Tarsatica ' s surviving inhabitants moved to a more protected hill , where they established a new settlement called Trsat . Višeslav continued to rule over the Dalmatian Croatia and warred against the Franks , avoiding defeat upon his death in 802 . He was succeeded by his son Borna , who later become a Frankish ally . On Christmas Day in 800 , Pope Leo III crowned Charlemagne as Imperator Romanorum ( Holy Roman Emperor ) in Saint Peter ' s Basilica . This was a direct challenge to Byzantium ' s claim to be the one - the Roman - empire . Nicephorus I of the Byzantine Empire and Charlemagne of the Holy Roman Empire settled their imperial boundaries in 803 . Dalmatian Croatia peacefully accepted a limited Frankish overlordship . The peace of Aache in 812 confirmed Dalmatia , except for the Byzantine cities and islands , as under Frankish domain . Ljudevit Posavski , Croatian Duke of Pannonian Croatia , led a resistance to Frankish domination . Ljudevit also had to fight against Dalmatian Croatia , as their prince Borna was a Frankish ally . After unsuccessful resistance by Ljudevit and Pannonian Croats , the Franks again controlled Istria , Dalmatia , and Pannonia . Nevertheless , Dalmatian Croatia remained a semi - independent duchy between the two Empires , as they had a right to elect their own prince .