After the First World War and the dissolution of Austria-Hungary, Slovaks and Czechs founded the common state of Czechoslovakia in 1918. The Trianon Treaty finally made Slovakia independent from Hungary after 1000 years under its rule. The Czechoslovak Republic managed to protect the Slovak territories from Hungarian revisionism until 1938, but tensions between Slovaks and Czechs increased, partly because of a centralist government in Prague. After the Munich Agreement and over the question of Hungarian minorities, southern Slovakia and the Carpathian Ukraine were ceded to Hungary after bilateral talks in November 1938.
After German threats to support a Hungarian invasion on 14 March 1939, the rest of the state, which had in the meantime been transformed into the second Czechoslovak Republic, was broken up. The Slovakian state parliament proclaimed an independent Slovak state. This first Slovakian nation state was a one-party dictatorship of the right-wing Slovak People’s Party under President Jozef Tiso and Prime Minister Vojtech Tuka. Particularly the latter advocated for unconditional collaboration with Nazi Germany. Slovakia took part in the invasion of Poland and the war against the Soviet Union. A few months after the outbreak of the Slovakian national uprising in August 1944, Slovakia was occupied by German troops. In April 1945 the occupation by the Red Army followed.
After the end of World War II, the Czechoslovak Republic was restored within the borders prior to the Munich Agreement except for the Carpathian Ukraine, which had to be surrendered to the Soviet Union. In 1948, the Communist Party of Czechoslovakia took power and initially established a Stalinist dictatorship. In the 1960s, the Slovakian part of the country was liberalized after Alexander Dubček became the first secretary of the Slovakian communists in 1963. After Dubček also became the head of the Communist Party of Czechoslovakia in early 1968, the Prague Spring phase of political liberalization began. However, it was crushed by Warsaw Pact troops in the same year. Dubčeks successor Gustáv Husák initiated the so-called normalization resulting in a pro-Soviet reorientation of the country. Husák implemented only one point of Dubček’s reform agenda: the state federalization, so that now Czechoslovakia was formed by the Slovak Socialist and the Czech Socialist Republic.
In 1988, people took to the streets in the Slovakian capital Bratislava as part of the "candlelight demonstration" for religious and civil rights. The demonstration was violently suppressed by security forces. That became the starting point of the "Velvet Revolution", which finally led to the end of the communist regime. Since 1 January 1993, Slovakia has been an independent state.