A part of the homeland of the Slavic Moravian Empire in the middle ages, Slovakia was conquered by the Magyars in the early 10th century and remained under Hungarian rule until 1918. With the defeat of Austria-Hungary in 1918, Slovakia united with the Czech regions of Bohemia and Moravia to form the Republic of Czechoslovakia. When the country was occupied by Germany in 1939, Slovakia was established as a separate German puppet-state. The Soviet army liberated the country in 1945 and it again became part of Czechoslovakia. The post-war communist republic was dominated by Czechs, and old ethnic rivalries were revived. When Czechoslovakia began to democratize in 1989, Slovakia began to pursue an increasingly nationalist course. In 1992 Czech and Slovak political leaders agreed to dissolve the union, and on January 1, 1993, the two republics formally separated.