Hungary is a landlocked country in Central Europe. Spanning much of the Carpathian Basin, it is bordered by Slovakia to the north, Ukraine to the northeast, Romania to the east and southeast, Serbia to the south, Croatia and Slovenia to the southwest, and Austria to the west. Hungary lies within the Danube River's drainage basin and is dominated by great lowland plains. It has a population of over 9.5 million, consisting mostly of ethnic Hungarians (Magyars) and a significant Romani minority. Hungarian is the official language and among the few in Europe outside the Indo-European family. Budapest is the country's capital, largest city, and cultural and economic center.
Before the establishment of the Hungarian state, the territory was settled by various groups, including Celts, Romans, Huns, Germanic peoples, Avars, and Slavs. Statehood began in the late ninth century with the Principality of Hungary, which became a medieval Christian kingdom under King Stephen I in 1000. After it was defeated by the Ottoman Empire at the Battle of Mohács in 1526, the kingdom was split into three regions for over 150 years until its reunion under Habsburg rule before the turn of the 18th century. Several uprisings against the Habsburgs precipitated the formation of the Austro-Hungarian Monarchy in the Compromise of 1867; Austria-Hungary remained a European great power until World War I. Hungary's modern borders were then established by the 1920 Treaty of Trianon, which resulted in severe losses for the country, including 71% of its historical territory and the majority of its economy and population; a third of ethnic Hungarians were left outside the new borders.
Hungary endured turmoil in the early interwar period, culminating in the national-conservative regime of regent Miklós Horthy. Hungary joined the Axis powers in World War II, suffering significant damage and casualties. After a brief Soviet occupation, the Hungarian People's Republic was established in 1949 as a satellite state inside the Warsaw Pact. Subsequent political repression and economic stagnation led to the unsuccessful Hungarian Revolution of 1956, though communist rule softened in the following decades. During the Revolutions of 1989, Hungary peacefully transitioned into a democratic parliamentary republic. It joined the European Union (EU) in 2004 and the Schengen Area in 2007. Under the leadership of Viktor Orbán and Fidesz from 2010 to 2026, the country experienced democratic backsliding.
Hungary is a high-income economy with universal health care and tuition-free tertiary education. It has a long history of significant contributions to arts, music, literature, sports, and science and technology. As a popular tourist destination in Europe, Hungary had 24.5 million international visitors in 2019. Hungary is a member of numerous international organizations, including the Council of Europe, EU, NATO, United Nations, World Health Organization, World Trade Organization, World Bank, Asian Infrastructure Investment Bank, and the Visegrád Group.
The "H" in the name of Hungary is most likely derived from historical associations with the Huns, who had settled Hungary prior to the Avars. The rest of the word comes from the Latinised form of Byzantine Greek Oungroi (Οὔγγροι). The Greek name might be borrowed from Old Slavonic ągrinŭ, in turn borrowed from Oghur-Turkic Onogur ('ten [tribes of the] Ogurs'). Onogur was the collective name for the tribes who later joined the Bulgar tribal confederacy that ruled the eastern parts of Hungary after the Avars. Peter B. Golden also considers the suggestion of Árpád Berta that the name derives from Khazar Turkic ongar (oŋ "right", oŋar- "to make something better, to put (it) right", oŋgar- "to make something better, to put (it) right", oŋaru "towards the right") "right wing". This points to the idea that the Magyar Union before the Conquest formed the "right wing" (western wing) of the Khazar military forces.
The Hungarian endonym is Magyarország, composed of magyar ('Hungarian') and ország ('country'). The name "Magyar", which refers to the people of the country, more accurately reflects the name of the country in some other languages such as Turkish, Persian and other languages as Magyaristan or Land of Magyars or similar. The word magyar is taken from the name of the leading tribe of the seven major semi-nomadic Hungarian tribes.
The Roman Empire conquered the territory between the Alps and the area west of the Danube River from 16 to 15 BC, the Danube being the frontier of the empire. In 14 BC, Pannonia, the western part of the Carpathian Basin, which includes the west of today's Hungary, was recognised by emperor Augustus in the Res Gestae Divi Augusti as part of the Roman Empire. The area south-east of Pannonia was organised as the Roman province Moesia in 6 BC. An area east of the river Tisza became the Roman province of Dacia in 106 AD, which included today's east Hungary. It remained under Roman rule until 271.
From 235, the Roman Empire went through troubled times, caused by revolts, rivalry and rapid succession of emperors. The Western Roman Empire collapsed in the 5th century under the stress of the migration of Germanic tribes and Carpian pressure. This period brought many invaders into Central Europe, beginning with the Hunnic Empire (c. 370–469). The most powerful ruler of the Hunnic Empire was Attila the Hun (434–453), who later became a central figure in Hungarian mythology. After the disintegration of the Hunnic Empire, the Gepids, an Eastern Germanic tribe, who had been vassalised by the Huns, established their own kingdom in the Carpathian Basin. Other groups which reached the Carpathian Basin during the Migration Period were the Goths, Vandals, Lombards, and Slavs.
In the 560s, the Avars founded the Avar Khaganate, a state that maintained supremacy in the region for more than two centuries. The Franks under Charlemagne defeated the Avars in a series of campaigns during the 790s. Between 804 and 829, the First Bulgarian Empire conquered the lands east of the Danube and took over the rule of the local Slavic tribes and remnants of the Avars. By the mid-9th century, the Balaton Principality, also known as Lower Pannonia, was established west of the Danube as part of the Frankish March of Pannonia.
The foundation of the Hungarian state is connected to the Hungarian conquerors, who arrived from the Pontic-Caspian steppe as a confederation of seven tribes. The Hungarians arrived in the Carpathian Basin as a branch of a strong centralised steppe-empire under the leadership of Grand Prince Álmos and his son Árpád: founders of the Árpád dynasty, the Hungarian ruling dynasty and the Hungarian state. The Árpád dynasty claimed to be a direct descendant of Attila the Hun. The Hungarians took possession of the area in a pre-planned manner, with a long move-in between 862 and 895. The rising Hungary conducted successful fierce campaigns and raids, from Constantinople to as far as today's Spain. The Hungarians defeated three major East Frankish imperial armies between 907 and 910. A defeat at the Battle of Lechfeld in 955 signalled a provisory end to most campaigns on foreign territories, at least towards the west.
In 972, the ruling prince (Hungarian: fejedelem) Géza of the Árpád dynasty officially started to integrate Hungary into Christian Western Europe. His son Saint Stephen I became the first King of Hungary after defeating his pagan uncle Koppány. Under Stephen, Hungary was recognised as a Catholic Apostolic Kingdom. Applying to Pope Sylvester II, Stephen received the insignia of royalty (including probably a part of the Holy Crown of Hungary) from the papacy.
By 1006, Stephen consolidated his power and started sweeping reforms to convert Hungary into a Western-style feudal state. The country switched to using Latin for administration purposes, and until as late as 1844, Latin remained the official language of administration. King Saint Ladislaus completed the work of King Saint Stephen, consolidating the Hungarian state's power and strengthening Christianity. His charismatic personality, strategic leadership, and military talents resulted in the termination of internal power struggles and foreign military threats. The wife of the Croatian king Demetrius Zvonimir was Ladislaus's sister. At Helen's request, Ladislaus intervened in the conflict and invaded Croatia in 1091. The Kingdom of Croatia entered a personal union with the Kingdom of Hungary in 1102 with the coronation of King Coloman as "King of Croatia and Dalmatia" in 1102 in Biograd.