Independent republic in the NW of the former Yugoslavia, with its capital at Ljubljana. Settled by Slovenes in the sixth century a.d. as the state of Samo, it was later under the Franks and the Bavarians. After 1335 most of the Slovene territory came under Austria, except for 1809 to 1813, when it was part of the Slavic Illyrian Provinces created by Napoleon.
In 1918 Slovenia joined other South Slavs in creating the Kingdom of the Serbs, Croats and Slovenes or, after 1931, Yugoslavia. During World War II Slovenia was divided between Hungary, Italy, and Germany.
It became a constituent republic of Yugoslavia in 1946. Slovenia, along with Croatia, was recognized as an independent country by the European Community and the United Nations in 1992. Serbian troop invaded Slovenia, but were forced to withdraw.
Milan KuCan was elected president of Slovenia in 1990, continued as president of the independent republic, and was reelected in 1997. In 2002, Janez Drnovsek, the prime minister, was elected president.
In 2004, Slovenia became a member of NATO and the European Union.