Middle Ages (895–1526)
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 frame 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.
One of the most powerful and wealthiest kings of the Árpád dynasty was Béla III, who disposed of the equivalent of 23 tonnes of silver per year, according to a contemporary income register. This exceeded the income of the French king (estimated at 17 tonnes) and was double the receipts of the English Crown. Andrew II issued the Diploma Andreanum which secured the special privileges of the Transylvanian Saxons and is considered the first autonomy law in the world. He led the Fifth Crusade to the Holy Land in 1217, setting up the largest royal army in the history of Crusades. His Golden Bull of 1222 was the first constitution in Continental Europe. The lesser nobles also began to present Andrew with grievances, a practice that evolved into the institution of the parliament (parlamentum publicum).
In 1241–1242, the kingdom received a major blow with the Mongol (Tatar) invasion. Up to half of Hungary's population of 2 million were victims of the invasion. King Béla IV let Cumans and Jassic people, who were fleeing the Mongols, into the country. Over the centuries, they were fully assimilated. After the Mongols retreated, King Béla ordered the construction of hundreds of stone castles and fortifications, to defend against a possible second Mongol invasion. The Mongols returned to Hungary in 1285, but the newly built stone-castle systems and new tactics (using a higher proportion of heavily armed knights) stopped them. The invading Mongol force was defeated near Pest by the royal army of King Ladislaus IV. As with later invasions, it was repelled handily, the Mongols losing much of their invading force.
The Kingdom of Hungary reached one of its greatest extents during the Árpádian kings, yet royal power was weakened at the end of their rule in 1301. After a destructive period of interregnum (1301–1308), the first Angevin king, Charles I of Hungary – a bilineal descendant of the Árpád dynasty – successfully restored royal power and defeated oligarch rivals, the so-called "little kings". The second Angevin Hungarian king, Louis the Great (1342–1382), led many successful military campaigns from Lithuania to southern Italy (Kingdom of Naples) and was also King of Poland from 1370. After King Louis died without a male heir, the country was stabilised only when Sigismund of Luxembourg (1387–1437) succeeded to the throne, who in 1433 also became Holy Roman Emperor.
The first Hungarian Bible translation was completed in 1439. For half a year in 1437, there was an antifeudal and anticlerical peasant revolt in Transylvania which was strongly influenced by Hussite ideas. From a small noble family in Transylvania, John Hunyadi grew to become one of the country's most powerful lords, thanks to his capabilities as a mercenary commander. He was elected governor, then regent. He was a successful crusader against the Ottoman Turks, one of his greatest victories being the siege of Belgrade in 1456.
The last strong king of medieval Hungary was the Renaissance king Matthias Corvinus (1458–1490), son of John Hunyadi. His election was the first time that a member of the nobility mounted the Hungarian royal throne without a dynastic background. He was a successful military leader and an enlightened patron of the arts and learning. His library, the Bibliotheca Corviniana, was Europe's greatest collection of historical chronicles, philosophic and scientific works in the 15th century, and second only in size to the Vatican Library. Items from the Bibliotheca Corviniana were inscribed on UNESCO's Memory of the World Register in 2005. The serfs and common people considered him a just ruler because he protected them from excessive demands and other abuses by the magnates. Under his rule, in 1479, the Hungarian army destroyed the Ottoman and Wallachian troops at the Battle of Breadfield. Abroad, he defeated the Polish and German imperial armies of Frederick at Breslau (Wrocław). Matthias' mercenary standing army, the Black Army of Hungary, was an unusually large army for its time, and it conquered Vienna as well as parts of Austria and Bohemia.
King Matthias died without lawful sons, and the Hungarian magnates procured the accession of the Pole Vladislaus II (1490–1516), supposedly because of his weak influence on Hungarian aristocracy. Hungary's international role declined, its political stability was shaken, and social progress was deadlocked. In 1514, the weakened old King Vladislaus II faced a major peasant rebellion led by György Dózsa, which was ruthlessly crushed by the nobles, led by John Zápolya. The resulting degradation of order paved the way for Ottoman preeminence. In 1521, the strongest Hungarian fortress in the South, Nándorfehérvár (today's Belgrade, Serbia), fell to the Turks. The early appearance of Protestantism further worsened internal relations in the country.