The earliest known inhabitants of the region were Celtic tribes. The Romans occupied the area in the 1st century A.D., and the area became part of a larger Roman territory called Pannonia. The Huns and the Avars invaded in the 5th century. In the 7th century, a leader named Samo established a short-lived empire. 

Christian missionaries began to arrive in the 7th century and the area was gradually converted to Christianity. In the early 9th century, the Slavs formed two states: the Kingdom of Great Moravia and the Principality of Nitra. In 833, under Prince Mojmír, the Moravians defeated the Principality of Nitra and formed the Great Moravian Empire.

The Magyars (known today as the Hungarians) invaded in the early 10th century and the area became part of the Hungarian empire. After the Magyars were defeated by the Turkish Ottomans at the battle of Mohács in 1526, the Hungarian empire was divided. Because the Ottomans ruled the area south of the Danube, Slovakia became the centre of Hungarian culture. Until 1835, all Hungarian monarchs were crowned in Slovakia.

During the 19th century, nationalism became an important political force in all European countries. Slovak nationalists like L'udovít Štúr promoted Slovakian independence. At the same time, Hungarian nationalism also grew. In 1867, the Hungarians began to impose their culture in a process known as "Magyarization." The Slovak language was suppressed.

  Did you know?
Svätopluk I, Ruler of Great Moravia from 871 to 894, is considered the greatest leader of the first western Slavic state. Under his reign, Great Moravia reached the peak of its power and territorial expansion.
The Austro-Hungarian Empire disintegrated in 1918 after its defeat in the First World War. With the help of Slovak leader Milan Rastislav Štefánik, Slovaks united with their neighbours to the west, the Czechs of Bohemia and Moravia, to form the Czecho-Slovak Republic. Prague became the capital city. Because Slovakia had been under Hungarian influence while the the Czechs had been influenced by Germany and Austria, the two separate cultures remained distinct in the new state.

During the Second World War, Nazi Germany annexed Moravia and Bohemia. Slovakia was proclaimed an independent state, dominated by Germany. In 1944, Slovak partisans rose against the Nazis. At the end of the war, Czechoslovakia was reunited. After 1948, when the Communists took power, all private property was confiscated by the state and nationalized. 

 In 1968, a Slovak, Alexander Dubcek, became head of the Communist party in Czechoslovakia. He wanted to introduce "Socialism with a human face." However, on the night of August 20-21, 1968, military units from the Soviet-dominated countries entered Czechoslovakia and occupied the major cities. The country remained under Soviet influence for another 20 years.

 In 1989, the Communist government in Czechoslovakia was removed in a peaceful transition called the "Velvet Revolution." In 1992, the Slovak Republic decided to separate from Czechoslavakia. The two independent republics were formed on January 1, 1993. Since independence, the government has concentrated on transforming a previously Communist country into a market economy.