the main passage from the Pannonian Plain to the Italian Peninsula. Rome finally abandoned the region at the end of the 4th century. Most cities were destroyed, while the remaining local population moved to the highland areas, establishing fortified towns. In the 5th century, the region was part of the Ostrogothic Kingdom, and was later contested between the Ostrogoths, the Byzantine Empire and the Lombards. Slavic settlement The Slavic ancestors of present-day Slovenes settled in the East Alpine area at the end of the 6th century. Coming from two directions, North (via today's East Austria and Czech Republic), settling in the area of today's Carinthia and west Styria, and South (via today's Slavonia), settling in the area of today's central Slovenia. King Samo This Slavic tribe, also known as the Alpine Slavs, was submitted to Avar rule before joining the Slavic King Samo's tribal union in 623 AD. After Samo's death, the Slavs of Carniola (in present-day Slovenia) again fell to Avar rule, while the Slavs north of the Karavanke range (in present-day Austrian regions of Carinthia, Styria and East Tyrol) established the independent principality of Carantania. Middle Ages Carantania to Carinthia In 745, Carantania and the rest of Slavic-populated territories of present-day Slovenia, being pressured by newly consolidated Avar power, submitted to Bavarian overrule and were, together with the Duchy of Bavaria, incorporated into the Carolingian Empire, while Carantanians and other Slavs living in present Slovenia converted to Christianity. The eastern part of Carantania was ruled again by Avars between 745 and 795. Carantania retained its internal independence until 818 when the local princes, following the anti-Frankish rebellion of Ljudevit Posavski, were deposed and gradually replaced by a Germanic (primarily Bavarian) ascendancy. Under Emperor Arnulf of Carinthia, Carantania, now ruled by a mixed Bavarian-Slav nobility, briefly emerged as a regional power, but was destroyed by the Hungarian invasions in the late 9th century. Carantania-Carinthia was established again as an autonomous administrative unit in 976, when Emperor Otto I, "the Great", after deposing the Duke of Bavaria, Henry II, "the Quarreller", split the lands held by him and made Carinthia the sixth duchy of the Holy Roman Empire, but old Carantania never developed into a unified realm. In the late 10th and beginning of the 11th century, primarily because of the Hungarian threat, the south-eastern border region of the German Empire was organized into so called "marks", that became the