In the north the Hapsburgs ruled, while in the east, the Principality of Transylvania was a semi-independent state subservient to the Ottoman Empire. The central lowlands became a subdivision of the Ottoman Empire, governed from Buda (Budapest).
Near the end of the 17th century, a league of factions organized by Pope Innocent XI, was sent to free Buda from Ottoman rule and reinstate the Catholic Church. By 1718, Ottoman control was greatly reduced in Hungary, and a large part of the population were reconverted to Catholicism.
Even after the-beginning-of-the-end for the Ottoman Empire, the Hapsburgs still controlled parts of Hungary. The Habsburgs were one of the most important aristocratic royal houses of Europe, best known for being the origin of all of the formally elected Holy Roman Emperors between 1438 and 1740, and still controlled parts of Hungary.
The remaining inhabitants of any Ottoman ruled areas were now ethnic Hungarians, but their numbers were greatly reduced as Serbs and Slavs were sent by the Hapsburgs into the south, and scattered groups of Germans moved in across the country.
On March 15, 1848, The Hungarian Revolution began. The revolution grew into a war for independence from the Austrian Empire, ruled by the Habsburg monarchy. Many of the Revolution leaders are among the most respected national heroes in Hungarian history. In fact, March 15 is one of Hungary's three national holidays.
In the war the Hungarians were supported by the Croatian, Serbian and Russian peasants, as well as by the in-country Slovak and German nationals, and by the Jewish population.
In the beginning, the Hungarian forces had some success, but when the Hapsburg Emperor, Franz Joseph I, gained the support of Czar Nicholas I, and the Russian armies consequently invaded Hungary, well, the end was near.
The Hungarian forces were now defeated, and Julius Jacob von Haynau, a general in the Austrian army, became governor of Hungary for a few months, and quickly ordered the execution of the leaders of the Hungarian army.
In an effort to eliminate any on-going underground resistance from the Hungarians, the dual monarchy of Austria-Hungary was established in 1867. The Compromise re-established the sovereignty of the Kingdom of Hungary, separate from and no longer subject to the Austrian Empire.
Regions of the monarchy were now governed by separate Austrian and Hungarian Parliaments and Prime Ministers, and in a brilliant strategy, overall unity was maintained through rule of a single head of state of both territories and governments.
At the time the Austria-Hungary Empire was the second largest in Europe and the third most populous. To Hungary's benefit, the old Hungarian Constitution was restored and Franz Joseph I was crowned King.
Impressive economic growth followed because Hungary soon modernized and promoted industrialization. In 1873, the three cities of Buda, Obuda and Pest were officially united, thus creating the new city of Budapest.
At the outbreak of World War I in 1914, over 8 million men mobilized into the Austria-Hungary army, but in the end, more than one million died during the course of that useless war.
Following the total military defeat of the Austro-Hungarian Dual Monarchy by the end of World War I, Hungary lost two-thirds of its territory and one-third of its population and the economy had cratered. Austria's losses were also horrendous, and in October of 1918, Hungary's union with Austria was dissolved.
Hungary experienced a brief but bloody communist dictatorship and counterrevolution in 1919, followed by the 25-year military rule of Admiral Miklos Horthy, a ruler that eventually guided Hungary into an alliance with Nazi Germany.