The Kingdom of Hungary was a monarchy in Central Europe that existed for nearly a millennium, from the Middle Ages into the 20th century. The Principality of Hungary emerged as a Christian kingdom upon the coronation of the first king Stephen I at Esztergom around the year 1000; his family (the Árpád dynasty) led the monarchy for 300 years. By the 12th century, the kingdom became a European middle power within the Western world.Due to the Ottoman occupation of the central and southern territories of Hungary in the 16th century, the country was partitioned into three parts: the Habsburg Royal Hungary, Ottoman Hungary, and the semi-independent Principality of Transylvania. The House of Habsburg held the Hungarian throne after the Battle of Mohács in 1526 continuously until 1918 and also played a key role in the liberation wars against the Ottoman Empire.
From 1867, territories connected to the Hungarian crown were incorporated into Austria-Hungary under the name of Lands of the Crown of Saint Stephen. The monarchy ended with the deposition of the last king Charles IV in 1918, after which Hungary became a republic. The kingdom was nominally restored during the "Regency" of 1920–46, ending under the Soviet occupation in 1946.The Kingdom of Hungary was a multiethnic state from its inception until the Treaty of Trianon and it covered what is today Hungary, Slovakia, Transylvania and other parts of Romania, Carpathian Ruthenia (now part of Ukraine), Vojvodina (now part of Serbia), the territory of Burgenland (now part of Austria), Međimurje (now part of Croatia), Prekmurje (now part of Slovenia) and a few villages which are now part of Poland. From 1102 it also included the Kingdom of Croatia, being in personal union with it, united under the King of Hungary.
According to demographers, about 80 percent of the population was made up of Hungarians before the Battle of Mohács; however, in the mid-19th century out of a population of 14 million less than 6 million were Hungarian due to the resettlement policies and continuous immigration from neighboring countries. Major territorial changes made Hungary ethnically homogeneous after World War I. More than nine-tenths of the population of modern Hungary is ethnically Hungarian and speaks Hungarian as their mother tongue.
Today, the feast day of the first king Stephen I (20 August) is a national holiday in Hungary, commemorating the foundation of the state (Foundation Day).