This area of flat plains and grasslands, bisected by the Danube River, was a favorite route of eastern tribes invading southern and western Europe. From the 4th to the 9th centuries, succeeding immigrations of Germans, Huns, Avars and other peoples passed through the region. Toward the end of the 9th century, Hungary was settled by the Magyars, who established a kingdom that embraced what is now Hungary, Croatia, Slovakia, and large parts of Serbia, Bosnia and Romania. For nearly a century the Magyars raided throughout central Europe, but under Stephen I (977-1038), they were converted to Christianity. For the next 500 years, Hungary served as Europe's eastern bulwark against the Asian tribes. In the early 16th century, the Ottoman Turks destroyed Hungarian power. Most of the country was conquered by the Turks, and the remaining northern and western fringe came under the rule of Hapsburg Austria. During 1686-1718, the Austrians expelled the Turks from Hungary. Austria completely dominated Hungary until the mid-19th century. Magyar nationalism forced the creation of the Austro-Hungarian Monarchy in 1867, after which Hungary was an equal partner with Austria. Having achieved its own nationalist goals, Hungary denied similar nationalist ambitions among its subject peoples. The Dual Monarchy's defeat in World War I brought the disintegration of the empire and of the Kingdom of Hungary. During 1918-20, the country was overrun by Serbian, French and Romanian armies and was torn by civil war between royalist and Bolshevik factions. Hungary emerged in 1920 as a nationalist state, having lost 50 percent of its population and 75 percent of its territory to Yugoslavia, Romania and Czechoslovakia. In 1938, Hungary participated in the dismemberment of Czechoslovakia and, during World War II, joined the Axis, regaining much of its former territory. In 1944-45, it was defeated by the Soviet Union and reduced to its pre-1938 boundaries. On Feb. 1, 1946, a republic was established, but in 1947, the communists ousted the president and purged noncommunist elements from the government. Demonstrations in October 1956, turned into open revolt against the regime. In early November, some 200,000 Soviet troops crushed the uprising, and a hard-line regime was re-established. Some 40,000 Soviet troops remained in Hungary, and Hungarian forces participated in the 1968 Warsaw Pact invasion of Czechoslovakia. Always one of the most liberal of the East Bloc nations, the Hungarian communist government allowed considerable economic freedom, at least by Soviet standards. As a result, Hungary was more economically developed and has enjoyed a smoother, more rapid conversion to a free market economy following the collapse of the Soviet Union. In 1989, the Communist Party was dissolved, and in 1991, the last Soviet troops left the country. Wary of a revived Russian threat in the future and desiring to integrate its economy with Western Europe, Hungary has sought firm ties with the rest of Europe. In 1999, it joined NATO.