The Romans established posts at Emona (Ljubljana), Poetovio (Ptuj), and Celeia (Celje); and constructed trade and military roads that ran across Slovene territory from Italy to Pannonia.
In the 5th and 6th centuries, the area was subject to invasions by the Huns and Germanic tribes during their incursions into Italy.
Patria del Friuli ruled present western Slovenia until Venetian takeover in 1420.
At the end of the Middle Ages, the Slovene Lands suffered a serious economic and demographic setback because of the Turkish raids.
In 2002, remains of pile dwellings over 4,500 years old were discovered in the Ljubljana Marshes, now protected as a UNESCO World Heritage Site, along with the Ljubljana Marshes Wooden Wheel, the oldest wooden wheel in the world.
In the transition period between the Bronze age to the Iron age, the Urnfield culture flourished.
During the same period Carniola, too, came under the Franks, and was Christianised from Aquileia.
In June 1991, after the introduction of multi-party representative democracy, Slovenia split from Yugoslavia and became an independent country.In December 1918, they merged with the Kingdom of Serbia into the Kingdom of Serbs, Croats and Slovenes (renamed Kingdom of Yugoslavia in 1929).During World War II, Slovenia was occupied and annexed by Germany, Italy, and Hungary, with a tiny area transferred to the Independent State of Croatia, a Nazi puppet state.Consequently, the Frankish feudal system reached the Slovene territory.After the victory of Emperor Otto I over the Magyars in 955, Slovene territory was divided into a number of border regions of the Holy Roman Empire.In the mid-8th century, Carantania became a vassal duchy under the rule of the Bavarians, who began spreading Christianity.Three decades later, the Carantanians were incorporated, together with the Bavarians, into the Carolingian Empire.After its disintegration following Samo's death in 658 or 659, the ancestors of the Slovenes located in present-day Carinthia formed the independent duchy of Carantania.The Carantanians, one of the ancestral groups of the modern Slovenes, particularly the Carinthian Slovenes, were the first Slavic people to accept Christianity.By the late Middle Ages, the historic provinces of Carniola, Styria, Carinthia, Gorizia, Trieste, and Istria developed from the border regions and were incorporated into the medieval German state.The consolidation and formation of these historical lands took place in a long period between the 11th and 14th centuries, and were led by a number of important feudal families, such as the Dukes of Spannheim, the Counts of Gorizia, the Counts of Celje, and, finally, the House of Habsburg.