# History of Hungary

"none" is preferred when the title is sufficiently descriptive; see [[WP:SDNONE]]
Part of a series on the :
History of Hungary :
Early history
Hungarian prehistory
The Carpathian Basin before the Hungarian conquest
Roman Pannonia
Hunnic Empire :
Early medievalKingdom of the Gepids454–567Ostrogothic Kingdom469–553Avar Khaganate567–822Hungarian invasions of Europe~800–970Hungarian conquest862–895 :
MedievalPrincipality of Hungary895–1000Kingdom of Hungary1000–1301Personal union with Croatia1102–1918Golden Bull1222Mongol invasion of Hungary1241–1242Kingdom of Hungary1301–1526Ottoman Wars1366–1526 :
Early modernReformation1520Ottoman Wars1526–1699Eastern Hungarian Kingdom1526–1570Royal Hungary1526–1699Ottoman Hungary1541–1699Principality of Transylvania1570–1711Bocskai uprising1604–1606Wesselényi conspiracy1664–1671Principality of Upper Hungary1682–1685Kingdom of Hungary1699–1867 :
Late modernRákóczi's War of Independence1703–1711Principality of Transylvania1711–1867Hungarian Reform Era1825–1848Revolution of 18481848–1849Hungarian State1849Austro-Hungarian Monarchy1867–1918Lands of the Crown of St. Stephen1867–1918World War I1914–1918Interwar period1918–1941Hungarian People's Republic1918–1919Hungarian Soviet Republic1919Hungarian Republic1919–1920Treaty of Trianon1920Kingdom of Hungary1920–1946First Vienna Award1938Governorate of Subcarpathia1939–1945Second Vienna Award1940Revisions of Délvidék1941World War II1941–1945 :
ContemporarySecond Hungarian Republic1946–1949Hungarian People's Republic1949–1989Revolution of 1956 1956Goulash Communism1956–1989Third Hungarian Republic1989–2012Hungarysince 2012 :
Topics
Hungarians
Timeline
History of Transylvania
Hungarian language
Kingdom of Hungary
Árpád dynasty
Holy Crown
Hungarian Kings
Nobility
Great Officers
Transylvanian Princes
Military
List of Wars
Christianity
Economy
Flag
Coat of arms
Literature
Music
Székelys
Jews
Budapest :
Hungary portal :
vte :
Hungary in its modern (post-1946) borders roughly corresponds to the Great Hungarian Plain (the Pannonian Basin) in Central Europe.
During the Iron Age, it was located at the crossroads between the cultural spheres of Scythian tribes (such as Agathyrsi, Cimmerians), the Celtic tribes (such as the Scordisci, Boii and Veneti), Dalmatian tribes (such as the Dalmatae, Histri and Liburni) and the Germanic tribes (such as the Lugii, Marcomanni). In 44 BC, the Sarmatians, Iazyges moved into the Great Hungarian Plain. In 8 AD, the western part of the territory (the so-called Transdanubia) of modern Hungary formed part of Pannonia, a province of the Roman Empire. Roman control collapsed with the Hunnic invasions of 370–410, the Huns created a significant empire based in present-day Hungary. In 453 they reached the height of their expansion under Attila the Hun. After the death of Attila, the empire collapsed in 455, and Pannonia became part of the Ostrogothic Kingdom. The western part of the Carpathian Basin was occupied by the Longobards and the eastern part by the Gepids. In 567, the Avars occupied the territory ruled by the Gepids. In 568, the Longobards moved to Italy from Transdanubia, and the Avars also occupied that territory, Khagan Bayan I established the Avar Khaganate. The Avars were defeated by the Franks and Bulgars, and their steppe-empire ended around 822.
The Hungarians took possession of the Carpathian Basin between 862 and 895, and the Principality of Hungary was established in the late 9th century by Álmos and his son Árpád through the conquest of the Carpathian Basin, the Hungarians secured the territory by the Battle of Pressburg in 907. The Christian Kingdom of Hungary was established in 1000 under King Saint Stephen, ruled by the Árpád dynasty for the following three centuries. In the high medieval period, the kingdom expanded to the Adriatic coast and entered a personal union with Croatia in 1102. In 1241, Hungary was invaded by the Mongols under Batu Khan. The medieval Kingdom of Hungary was a European power, reaching its height in the 14th-15th century. Hungary bore the brunt of the Ottoman wars in Europe during the 15th century. After a long period of Ottoman wars, Hungary's forces were defeated at the Battle of Mohács and its capital was captured in 1541, opening roughly a 150 years long period when the country was divided into three parts: Royal Hungary loyal to the Habsburgs, Ottoman Hungary and the largely independent Principality of Transylvania. The reunited Hungary came under Habsburg rule at the turn of the 18th century, fighting a war of independence in 1703–1711, and a war of independence in 1848–1849 until a compromise allowed the formation of the Austro-Hungarian Monarchy in 1867, a major power into the early 20th century. The Croatian–Hungarian Settlement of 1868 settled the political status of the Kingdom of Croatia-Slavonia within the Lands of the Crown of Saint Stephen which was the official name for the Hungarian territories of the Dual Monarchy.
Austria-Hungary collapsed after World War I, and the subsequent Treaty of Trianon in 1920 established Hungary's current borders, resulting in the loss of 72% of its historical territory, 58% of its population, and 32% of its ethnic Hungarians. Two-thirds of territory of the Kingdom of Hungary was ceded to Czechoslovakia, the Kingdom of Romania, the Kingdom of Serbs, Croats and Slovenes, the First Austrian Republic, the Second Polish Republic and the Kingdom of Italy. A short-lived People's Republic was declared. It was followed by a restored Kingdom of Hungary but was governed by a regent, Miklós Horthy. He officially represented the Hungarian monarchy of Charles IV, Apostolic King of Hungary. Between 1938 and 1941, Hungary recovered part of her lost territories. During World War II Hungary came under German occupation in 1944, then under Soviet occupation until the end of the war. After World War II, the Second Hungarian Republic was established within Hungary's current-day borders as a socialist People's Republic, lasting from 1949 to the end of communism in Hungary in 1989. The Third Republic of Hungary was established under an amended version of the constitution of 1949, with a new constitution adopted in 2011. Hungary joined the European Union in 2004.

## Early history
### Prehistory

Middle Paleolithic presence of Homo heidelbergensis is evidenced by the discovery of the "Samu" fossil, dated to c. 300,000 years ago, with traces of habitation as old as 500,000 years ago. Presence of anatomically modern humans dates to c. 33,000 years ago (Aurignacian). Neolithization began with the Starčevo–Kőrös–Criș culture, c. 6000 BC. The Bronze Age began with the Vučedol culture (Makó culture), c. 3000 BC.
The Iron Age commenced around 800 BC, associated with "Thraco-Cimmerian" artefacts, representing the overlap of the pre-Scythian (Novocherkassk culture) and pre-Celtic (Hallstatt culture) cultural spheres. Hallstatt occupation of western Transdanubia is evident from about 750 BC. Early Greek ethnography locates the Scythian Agathyrsi and the Sigynnae in the region. The Pannonians were also important residents.
The classic Scythian culture spread across the Great Hungarian Plain between the 7th–6th century BC.
Their dominance was broken by the Celtic settlement which began in the 4th century BC. By 370 BC the Celts occupied most of Transdanubia from the Pannonians, and around 300 BC they waged successful war against the Scythians. Archaeological evidence shows the advanced state of agriculture and pottery of the La Tène culture. Southern Transdanubia was controlled by the most powerful Celtic tribe, the Scordisci, who were resisted from the east by the Dacians.
The Dacians were dominated by the Celts until the 1st century BC, when the tribes were united by Burebista. Dacia subdued the Scordisci, Taurisci and Boii, however Burebista died shortly after and the centralized power collapsed.

### Roman rule

Prior to the invasions, the Romans maintained friendly relations and traded with the locals. The Roman Empire conquered the territory of modern-day Hungary in multiple waves. Between 35 and 8 BC, Augustus and his son Tiberius fought the Pannonians for the Drava-Sava region, crushing the Scordisci and some rebellious tribes further south—adding the acquired territories to Illyricum province. Following these successes the tribes in Transdanubia surrendered without opposition. Temporarily the Danube was also exceeded, but the arrival of the Iazyges and another uprising forced the Romans to consolidate their gains at the river border. Soon the province of Pannonia formed. Its first city became Emona, modern-day Ljubljana. Other important Latin settlements were Sirmium (Sremska Mitrovica), Savaria (Szombathely), Siscia (Sisak) and Poetovio (Ptuj). Road building started in a high pace: the Danubian road network made sailing in the river possible. During the Marcomannic Wars, Pannonia suffered devastation by a powerful alliance of barbaric peoples led by the Marcomanni, but after they were defeated, an age of prosperity started.
The Dacians to the east reunited under Decebalus, harassing the limes, the Roman frontier defense system. Trajan, who achieved the greatest territorial extent of the empire, defeated them in two wars (98–117) and established the province of Dacia in 106. Decebalus committed suicide. Latin, Greek and Asiatic colonists settled on the decimated indigenous people, establishing Ulpia Traiana, Napoca (Cluj-Napoca), Apulum (Alba Iulia), Porolissum (Mirșid) and Potaissa (Turda) among others. They heavily exploited the gold and silver mines of Transylvania. Finally, the southward movement of the Germanic Goths forced Emperor Aurelian to evacuate the province in 271.
After a long period of secure Roman rule, from the 320s Pannonia was in frequent war with the East Germanic and Sarmatian peoples to the north and east. Both the Vandals and the Goths marched through the province, causing huge destruction. After the division of the Roman Empire, Pannonia remained under the rule of the Western Roman Empire, although the district of Sirmium was actually more in the sphere of influence of the East. As the Latin population of the province fled from the continuous barbarian incursions, Hunnic groups began to appear on the verge of the Danube. Under King Rugila, the nomads settled the Great Hungarian Plain, pushing the border guarding peoples westward, but stopping them from reaching Italy in exchange for the transfer of Eastern Pannonia. In 433, Aëtius played the western part too into Attila's hand for suppressing the Burgundians.

### Migration period

The Pannonian provinces suffered from the Migration Period from 379 onwards, the settlement of the Goth-Alan-Hun ally caused repeated serious crises and devastations, the contemporaries described it as a state of siege, Pannonia became an invasion corridor both in the north and in the south. The flight and emigration of the Romans began after two hard decades in 401, this also caused a recession in secular and ecclesiastical life. The Hun control gradually expanded over Pannonia from 410, finally the Roman Empire ratified the cession of Pannonia by treaty in 433. The flight and emigration of the Romans from Pannonia continued without interruption until the invasion of the Avars. The largest Roman emigration was the earliest and the 5th and 6th centuries were a phase of gradual emigration.
In 453, King Attila died suddenly, resulting in the quick disintegration of his empire. The Huns withdrew to Eastern Europe following the defeat of Attila's son, Ellac, by a coalition of Germanic tribes from the Carpathian Basin. Consequently, the Ostrogoths and Gepids established their kingdoms in the western and eastern part of the Carpathian Basin. Their wars left the region in ruins when King Theodoric abandoned it for the Italian Peninsula, leaving a power vacuum in Pannonia. From the beginning of the 6th century, the Lombards gradually took possessions in the region, eventually reaching Sirmium, the contemporary capital of the Gepid Kingdom. After a series of wars involving the Byzantines, the latter finally fell to the invasion of the nomadic Pannonian Avars led by Khagan Bayan I. Due to their fear of the powerful Avars, the Lombards also departed in 568, thereafter the whole basin came under the rule of the Avar Khaganate.
The rule of the Germanic peoples was followed by almost two and a half centuries of nomadic rule. The Avar khagan controlled a vast amount of territory spanning from Vienna to the Don river, often waging war against the Byzantines, Germans and Italians. The Pannonian Avars and the other freshly arrived steppe peoples in their confederation, such as the Kutrigurs, intermingled with Slavic and Germanic elements, and completely absorbed the Sarmatians. Archaeological evidence indicates that in the southern border, which was in state of constant fighting with the Byzantines, Avar settlements were built very densely. The Avars played an important role in the Slavic migrations to Southeastern Europe. After a failed attempt to capture Constantinople in 626, the submitted peoples rose up against their domination, with many like the Onogurs in the east and the Slavs of Samo in the west breaking away. The creation of the First Bulgarian Empire distanced the Byzantine Empire from the Avar Khaganate, so the expanding Frankish Empire became its new main rival.
After Charlemagne of Francia sat on the Bavarian throne in 788, the two countries started to share a wide border. Border conflicts were usual. In 791, they engaged in full war. After the Franks won a quick and important victory in the Vienna Woods, the Avars adopted the strategy of "scorched-earth", avoiding new engagements and destroying enemy food supplies. Four years later, a civil war broke out in the khaganate, with many high-ranking persons, including the khagan himself falling. Transdanubia was vassalized by Charlemagne, and after an uprising against his superiority, brutally annexed as the Avar March (later the March of Pannonia) with much its population slaughtered. Beyond the Danube, the Bulgars, led by their energetic khan Krum routed the army of the new khagan in 804, who fled to court of the now Emperor of the Romans. The Avar Khaganate virtually ceased to exist.
Although diminished, the Avars continued to inhabit the Carpathian Basin. The most significant stock became the rapidly increasing Slavs who entered the territory mainly from the south. Under the expansionist policy of the Kingdom of the East Franks, (since the division of the Frankish Empire in 843) the rudimentary Slavic polities couldn't develop, except one, the Principality of Moravia, which was able to expand into modern-day Western Slovakia. The Bulgarians lacked the power to establish effective control over Transylvania.

## Medieval Hungary
### Conquest and early principality (895–1000)

Foundation of the Hungarian state is connected to the Hungarian conquerors, who arrived from the Pontic steppes as a confederation of seven tribes. The Hungarians arrived in the frame of a strong centralized steppe-empire under the leadership of Grand Prince Álmos and his son Árpád, they became 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 the great Hun leader Attila. The Hungarians took possession of the Carpathian Basin in a pre-planned manner, with a long move-in between 862 and 895. From 894, when armed conflicts opened with the Bulgarians and Moravians after the requests for help from Arnulf, Frankish king and Leo VI, Byzantine emperor. During the occupation, the Hungarians found sparse population and met no well-established states. They were able to take over the basin quickly, defeating the First Bulgarian Tsardom, disintegrating the Principality of Moravia, and firmly establishing their state there by 900. Attacks were led by gyula Árpád and kende Kurszán, the two highest-ranking leaders, who left no mass graves behind them showing that the transition back to an Avar-like system was peaceful for the locals. Archaeological findings indicate that they settled in the lands near the Sava and Nyitra. The military power of the nation allowed the Hungarians to conduct successful fierce campaigns as far as the territories of modern Spain.
Just a few decades after the collapse of the Avar Khaganate in 822, once again a steppe empire, the Hungarian Grand Principality united the Carpathian Basin under its rule. The local Avar population did not resist, and even became part of the Hungarians, the Moravians fled or assimilated, the modest Bulgarian sovereignty in South Transylvania did not become a political factor, only the East Frankish Empire had such military power that it could intervent in the formation of the new order. His leadership also wanted to eliminate the new steppe state because the East Frankish Empire lost Pannonia and its Christian Avar taxpayers, and his territory was hit by increasing attacks by the Hungarians, especially Bavaria, which was then the eastern province of the Eastern Frankish Kingdom. In 907, three East Francian armies led by Luitpold, Margrave of Bavaria, which entered the Hungarian territory in order to expel the Hungarians from the Carpathian Basin, is annihilated by the Hungarian army at the Battle of Pressburg. Luitpold, Margrave of Bavaria, Dietmar I, Archbishop of Salzburg, Prince Sieghard, 19 counts, 2 bishops, and 3 abbots are killed in the battle, together with the majority of the soldiers. The Hungarian army immediately attacked Bavaria, and the Bavarian army led by King Louis the Child was defeated at Ennsburg. The victorious Hungarians defeated other Bavarian armies at Regensburg, Lengenfeld. The Hungarian victory forced the new Bavarian prince, Luitpold's son, Arnulf to conclude a peace treaty, the prince recognized the loss of Pannonia and Ostmark, pushing Hungary's borders deep in the Bavarian territory, the river Enns became borderline, paid tribute, and agreed to let the Hungarian armies, which went to war against Germany or other countries in Western Europe, to pass through the duchies lands. In 908, after the Battle of Eisenach, the victory of the Hungarian campaigns against the German duchies continued until 910, the battles of Augsburg and Rednitz, ended with disastrous German defeats, after which the German king Louis the Child concluded peace with the Principality of Hungary, accepting to pay tribute to the latter, and recognizing the Hungarian territorial gains during the war. The most significant result of the Battle of Pressburg is that the Hungarians secured the lands they gained during the Hungarian conquest of the Carpathian Basin, and prevented a future German invasion, the Germans did not launch an imperial scale campaign against Hungary for 123 years until 1030.
A defeat at the Battle of Lechfeld in 955 signaled an end to raids on western territories, although they continued into lands controlled by the Byzantine Empire until 970, and links between the tribes weakened.
Duke Géza (c. 940–997) of the Árpád dynasty, who ruled only part of the united territory, was the nominal overlord of all seven Magyar tribes. He aimed to integrate Hungary into Christian Western Europe. Duke Géza established a dynasty by naming his son Vajk (later King Stephen I of Hungary) as his successor. This decision was contrary to the dominant tradition of the time to have the eldest surviving member of the ruling family succeed the incumbent. After Géza's death in 997, Koppány took up arms, and many subjects in Transdanubia joined him. The rebels claimed to represent the old political order, ancient human rights, tribal independence and pagan belief. Stephen won a decisive victory over Koppány and had him executed.
The name Hungary derives from the designation Οὔγγροι for the Magyars, first recorded in Byzantine sources of the 9th century (in the 10th century as Latin Ungarii). During the Middle Ages, Byzantine sources also referred to the Magyar state as Tourkia (Turkey) (Greek: Τουρκία). The name Tourkia is also inscribed on the Corona graeca of the Holy Crown of Hungary.

### Patrimonial Kingdom (1000–1301)

Hungary was recognized as an Apostolic Kingdom under Saint Stephen I. According to later Hungarian tradition, Stephen was crowned with the Holy Crown of Hungary on the first day of the second millennium in the capital city of Esztergom. Pope Sylvester II conferred on him full administrative authority over bishoprics and churches. By 1006, Stephen had solidified his power by eliminating all rivals. Stephen established a network of ten episcopal and two archiepiscopal sees, and ordered the buildup of monasteries, churches and cathedrals. The Hungarian language switched from a runic-like script to the Latin alphabet under Stephen, and Latin was the official language of the country between 1000 and 1844. Stephen followed the Frankish administrative model. The land was divided into counties (megyék), each under a royal official called an ispán (equivalent to the title count, Latin: comes), later főispán (Latin: supremus comes). This official represented the king's authority, administered his subjects, and collected the taxes that formed the national revenue. Each ispán maintained an armed force of freemen at his fortified headquarters ("castrum" or "vár").
After the Great Schism between Western Roman Catholic and Eastern Orthodox Christianity was formalized in 1054, Hungary viewed itself as the easternmost bastion of Western civilisation, a judgment affirmed in the 15th century by Pope Pius II: "Hungary is the shield of Christianity and the protector of Western civilization".
King Saint Ladislaus completed the work of King Saint Stephen. He consolidated the Hungarian state power and strengthened the influence of Christianity. His charismatic personality, strategic leadership and military talents resulted 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.
The Árpád dynasty produced monarchs throughout the 12th and 13th centuries. King Béla III (r. 1172–1196) was the wealthiest and most powerful member of the dynasty, with an annual equivalent of 23,000 kg of pure silver in his income register. This exceeded the resources of the French king and was double the amount available to the English Crown. In 1195, Béla expanded the Hungarian kingdom southward and westward to Bosnia and Dalmatia and extended suzerainty over Serbia, a process that helped to break up the Byzantine Empire and diminish its influence in the Balkan region.
The early 13th century in Hungary was distinguished by the reign of King Andrew II (r. 1205–1235). In 1211, he granted the Burzenland (in Transylvania) to the Teutonic Knights but in 1225 expelled them. Andrew set up the largest royal army in the history of the Crusades when he led the Fifth Crusade to the Holy Land in 1217. In 1224, he issued the Diploma Andreanum, which unified and ensured the special privileges of the Transylvanian Saxons.
Andrew II was forced to accept the Golden Bull of 1222, which was the Hungarian equivalent of England's Magna Carta. The Golden Bull had a twofold purpose that limited royal power. On the one hand, it reaffirmed the rights of the smaller nobles of the old and new classes of royal servants (servientes regis) against both the crown and the magnates. On the other hand, it defended the rights of the whole nation against the crown by restricting the powers of the latter in certain fields and making refusal to obey its unlawful/unconstitutional commands (the ius resistendi) legal. The lesser nobles also began to present Andrew with grievances, a practice that evolved into the institution of the Parliament, or Diet. Hungary became the first country in which a parliament had supremacy over the kingship. The most important legal ideology was the Doctrine of the Holy Crown, which held that sovereignty belonged to the noble nation (as represented by the Holy Crown). The members of the Holy Crown were the citizens of the Crown's lands, and no citizen could attain absolute power over the others.

#### Mongol invasions

In 1241–1242, the kingdom suffered a major blow in the wake of the Mongol invasion of Europe. After Hungary was invaded by the Mongols in 1241, the Hungarian army was defeated disastrously at the Battle of Mohi. King Béla IV fled the battlefield and then the country. Before the Mongols retreated, a large part of the population (20-50%) died. In the plains, between 50 and 80% of the settlements were destroyed. Only castles, strongly fortified cities and abbeys could withstand the assault, as the Mongols had no time for long sieges. The siege engines and the Chinese and Persian engineers that operated them for the Mongols had been left in the conquered lands of Kyivan Rus'. The devastation caused by the Mongol invasions later led to the invitation of settlers from other parts of Europe, especially from Germany.
During the Mongols' campaign against Kievan Rus, some 40,000 Cumans, members of a nomadic tribe of pagan Kipchaks, were driven west of the Carpathian Mountains. The Cumans appealed to King Béla IV for protection. The Iranian Jassic people came to Hungary together with the Cumans after they were defeated by the Mongols. Cumans constituted perhaps up to 7–8% of the population of Hungary in the second half of the 13th century. Over the centuries they were fully assimilated into the Hungarian population, but they preserved their identity and their regional autonomy until 1876.
As a consequence of the Mongol invasions, King Béla ordered the construction of hundreds of stone castles and fortifications to defend against a possible second invasion. The Mongols did indeed return in 1286, but the newly built stone-castle systems and new military tactics involving 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. Later invasions were also repelled. The castles built by Béla IV proved to be very useful against the Ottoman Empire. However, the cost of building them indebted the Hungarian king to the major feudal landlords, so that royal power was once again dispersed among the lesser nobility.

### Late medieval period (1301–1526)
#### Árpád succession

After a destructive period of interregnum (1301–1308), the first Angevin king of Hungary, Charles I ("Charles the Great") successfully restored royal power and defeated oligarchic rivals known as the "little kings". A descendant of the Árpád dynasty in the female line, he reigned between 1308 and 1342. His new fiscal, customs and monetary policies proved successful.
One of the primary sources of the new king's power was the wealth derived from the gold mines of eastern and northern Hungary. Production eventually reached 3,000 lb. (1350 kg) annually—one-third of the total production of the world as then known and five times as much as that of any other European state. Charles also sealed an alliance with Polish King Casimir the Great. After Italy, Hungary was the first European country in which the Renaissance appeared. One sign of its progressiveness was the establishment of a printing press in Buda in 1472 by András Hess, one of the earliest outside of the German lands.
Louis the Great (r. 1342–1382) extended his rule as far as the Adriatic Sea and occupied the Kingdom of Naples several times. In 1351, the Golden Bull of 1222 was completed with a law of entail. This stipulated that the nobles' hereditary lands could not be taken away and must remain in the possession of their families. Louis became king of Poland from 1370 to 1382. The epic hero of Hungarian literature and warfare, the king's champion Miklós Toldi lived during his reign. Louis had become popular in Poland because of his campaign against the Tatars and pagan Lithuanians. In two successful wars against Venice (1357–1358 and 1378–1381), he was able to annex Dalmatia, Ragusa and other territories on the Adriatic Sea. Louis retained his strong influence in the political life of the Italian Peninsula for the rest of his life.
Some Balkan states (such as Wallachia, Moldova, Serbia, and Bosnia) became his vassals while the Ottoman Turks confronted them ever more often. In 1366 and 1377, Louis led successful campaigns against the Ottomans (such as the Battle of Nicapoli in 1366). From the time of the death of Casimir the Great in 1370, he was also king of Poland. He established a university in Pécs in 1367.
King Louis died without a male heir, and after years of civil war, the future Holy Roman Emperor Sigismund (r. 1387–1437) succeeded to the throne by marrying the daughter of Louis the Great, Mary of Hungary (who was herself crowned a "king" in 1382), becoming an official co-ruler and consolidating his power. Sigismund had to pay for the support of the lords by transferring a sizeable part of the royal properties. For some years, the baron's council governed the country in the name of the Holy Crown; the king was even imprisoned for a short time. The restoration of the authority of the central administration took decades. After Mary's death, Sigismund ruled as a sole ruler for life.
In 1404, Sigismund introduced the Placetum Regnum. According to this decree, Papal bulls and messages could not be pronounced in Hungary without the consent of the king. Sigismund summoned the Council of Constance that met between 1414 and 1418 to abolish the Avignon Papacy and end the Western Schism, which was resolved by the election of Pope Martin V. During his long reign, the royal castle of Buda became probably the largest Gothic palace of the late Middle Ages.
After the death of Sigismund in 1437, his son-in-law, Albert II of Germany, assumed the title King of Hungary. In 1437, there was an anti-feudal and anti-clerical peasant revolt in Transylvania which was strongly influenced by Hussite ideas. The first Hungarian Bible translation was completed in 1439 just before Albert's death in 1439.
John Hunyadi grew to become one of the country's most powerful lords, thanks to his capabilities as a mercenary commander. In 1446, the parliament elected him governor (1446–1453), then regent (1453–1456). He was a successful crusader against the Ottoman Turks, with one of his greatest victories the Siege of Belgrade in 1456.

#### Matthias Corvinus

The last strong Hungarian king was Matthias Corvinus (r. 1458–90), the son of John Hunyadi. His accession represented the first time in the history of the medieval Hungarian kingdom that a member of the nobility without dynastic ancestry mounted the royal throne. Although very prominent in the governing of the kingdom of Hungary, Matthias's father John Hunyadi was never crowned king. Matthias was a true Renaissance prince: a successful military leader and administrator, a linguist, an astrologer, and a patron of the arts and learning. Although he regularly convened the Diet and expanded the lesser nobles' powers in the counties, he exercised absolute rule over Hungary by means of a huge secular bureaucracy.
Matthias set out to build a realm that would expand to the south and northwest, while implementing internal reforms. The serfs considered Matthias a just ruler, because he protected them from abuses by the magnates. Like his father, Matthias desired to strengthen the kingdom of Hungary to the point where it could become the foremost regional power, indeed strong enough to push back the Ottoman Empire; towards that end he deemed it necessary to conquer large parts of the Holy Roman Empire.
King Matthias' standing professional mercenary army was called the Black Army of Hungary (Hungarian: Fekete sereg). Matthias recognized the importance and key role of early firearms in the infantry, which greatly contributed to his victories. Every fourth soldier in the Black Army had an arquebus, which was an unusual ratio at the time. In the great Viennese military parade in 1485, the Black Army consisted of 20,000 horsemen and 8,000 infantry. The Black Army was larger than the army of King Louis XI of France, the only other existing permanent professional European army in the era. The Hungarian army destroyed the three times bigger attacking Ottoman and Wallachian troops at the Battle of Breadfield in Transylvania in 1479. The battle was the most significant victory for the Hungarians against the raiding Ottomans, and as a result, the Ottomans did not attack southern Hungary or Transylvania for many years thereafter. The Black Army recaptured Otranto in Italy from the Ottoman Empire in 1481 and it secured a series of victories in the Bohemian–Hungarian War of 1468–78 by conquering parts of Bohemia, as well as parts of Austria, including Vienna in 1485 in the Austrian–Hungarian War of 1477–1488.
Matthias's library, the Bibliotheca Corviniana, was Europe's greatest collection of historical chronicles and works of philosophy and science in the 15th century, and second in size only to the Vatican Library. The library, which was destroyed in 1526 after Hungarian forces at Mohács were defeated by the Ottomans, is registered as a UNESCO Memory of the World site. Matthias died in 1490 without a legal successor, engendering a serious political crisis in the Hungarian kingdom.

#### Decline and partition

Events of 1490–1526 created conditions that would lead to a loss of independence. Besides internal conflicts, the Hungarian state was gravely threatened by the expanding Ottoman Empire. By the early 16th century, the Ottoman Empire had become the second most populous political state in the world, which facilitated the raising of the largest armies of the era. However, Hungarian policy makers at the time were not as conscious of this threat as they should have been.
Instead of preparing for the defence of the country against foreign powers, Hungarian magnates were much more focused on the threat to their privileges from a strong royal power. The magnates arranged for the accession of King Vladislaus II of Bohemia precisely because of his notorious weakness. During his reign (1490–1516), the central power experienced severe financial difficulties, largely because of the enlargement of feudal lands at his expense. The magnates also dismantled the administrative systems that had worked so successfully for Matthias. The country's defenses declined as border guards and castle garrisons went unpaid, fortresses fell into disrepair, and initiatives to increase taxes to reinforce defenses were stifled. Hungary's international role was neutralized, its political stability shaken, and social progress was deadlocked.
In 1514, the weakened and aging Vladislaus faced a major peasant rebellion led by György Dózsa. It was ruthlessly crushed by the Hungarian nobles led by János Szapolyai. The resulting degradation of order paved the way for Ottoman ambitions. In 1521, the strongest Hungarian fortress in the south, Nándorfehérvár (modern Belgrade), fell to the Turks, and in 1526 the Hungarian army was crushed at the Battle of Mohács. The young King Louis II died in the battle. The early appearance of Protestantism further worsened internal unity in the anarchical country.

## Early modern period
### Ottoman wars

After the Ottomans achieved their first decisive victory, their forces conquered large parts of the kingdom of Hungary and continued their expansion until 1556. This period was characterized by political chaos. A divided Hungarian nobility elected two kings simultaneously, Szapolyai and the Austrian Ferdinand of Habsburg. Armed conflicts between the rival monarchs further weakened the country. With the Turkish conquest of Buda in 1541, Hungary was riven into three parts.
The northwestern part of the old kingdom of Hungary (present-day Slovakia, western Transdanubia and Burgenland, plus western Croatia and parts of present-day northeastern Hungary) remained under Habsburg rule as the realm of King Ferdinand. Although initially independent, it would later become a part of the Habsburg monarchy under the informal name Royal Hungary. The Habsburg emperors would from then on be crowned also as kings of Hungary. The Turks were unable to conquer the northern and western parts of Hungary.
The eastern part of the kingdom (Partium and Transylvania) at first became an independent principality but gradually became a vassal state of the Ottoman Empire. The remaining central area (most of present-day Hungary), including the capital of Buda, became a province of the Ottoman Empire. Much of the land was devastated by recurrent warfare. Rural people living in the new Ottoman provinces could survive only in larger settlements known as Khaz towns, which were owned and protected directly by the sultan.
The Turks were indifferent to the Christian denominations practiced by their Hungarian subjects. For this reason, a majority of Hungarians living under Ottoman rule became Protestant (largely Calvinist), as Habsburg counter-Reformation efforts could not penetrate the Ottoman lands. Largely throughout this time, Pozsony (in German, Pressburg, today Bratislava) acted as the capital of the kingdom of Hungary (1536–1784), the town in which the Hungarian kings were crowned (1563–1830) and the seat of the Diet of Hungary (1536–1848). Nagyszombat (modern Trnava) acted in turn as the religious center beginning in 1541. The vast majority of the soldiers in service in the Ottoman fortresses in the territory were Orthodox and Muslim Balkan Slavs, instead of ethnic Turkish people. In 1558 the Transylvanian Diet of Turda declared free practice of both the Catholic and Lutheran religions but prohibited Calvinism. In 1568, the diet extended this freedom, declaring that, "It is not allowed to anybody to intimidate anybody with captivity or expulsion for his religion". Four religions were declared as accepted (recepta), while Orthodox Christianity was "tolerated" (though the building of stone Orthodox churches was forbidden). When Hungary entered the Thirty Years' War of 1618–48, Royal (Habsburg) Hungary joined the Catholic side, then Transylvania joined the Protestant side.
In 1686, two years after the unsuccessful Battle of Buda, a renewed European campaign was started to re-take the Hungarian capital. The army of the Holy League was over 74,000 men, including German, Croat, Dutch, Hungarian, English, Spanish, Czech, Italian, French, Burgundian, Danish and Swedish soldiers. The Christian forces reconquered Buda in the second Battle of Buda. The second Battle of Mohács (1687) was a crushing defeat for the Turks. In the next few years, all former Hungarian lands, except areas near Timișoara (Temesvár), were taken back from the Turks. At the end of the 17th century, Transylvania also became part of Hungary. In the Treaty of Karlowitz of 1699, these territorial changes were officially recognised, and in 1718, the entire kingdom of Hungary was removed from Ottoman rule.
As a consequence of the constant warfare between Hungarians and Ottoman Turks, population growth was stunted, and the network of medieval settlements with their urbanized bourgeois inhabitants perished. The 150 years of Turkish wars fundamentally changed the ethnic composition of Hungary. As a result of demographic losses, including deportations and massacres, the number of ethnic Hungarians at the end of the Turkish period was substantially diminished.

### Anti-Habsburg uprisings

There was a series of anti-Habsburg uprisings between 1604 and 1711. With the exception of the last, all took place within the territories of Royal Hungary but were usually organized from Transylvania. The last uprising was led by Francis II Rákóczi, who took power as the "Ruling Prince" of Hungary after the declared dethronement of the Habsburgs in 1707 at the Diet of Ónod.
Despite some successes by the anti-Habsburg Kuruc army, such as the near-capture of the Austrian Emperor Joseph I by Ádám Balogh, the rebels lost the decisive Battle of Trenčín in 1708. When Austrians defeated the Kuruc uprising in 1711, Rákóczi was in Poland. He later fled to France, then to Turkey, and died in 1735 in Tekirdağ (Rodosto). Afterward, to make further armed resistance infeasible, the Austrians demolished most of the castles on the border between the reclaimed territories occupied earlier by the Ottomans and Royal Hungary.

## Modern history
### Period of Reforms (1825–1848)

Hungarian nationalism emerged among intellectuals influenced by the Age of Enlightenment and Romanticism. It grew rapidly, providing the foundation for the revolution of 1848–49. There was a special focus on the Magyar language, which replaced Latin as the language of the state and the schools. In the 1820s, Emperor Francis I was forced to convene the Hungarian Diet, which inaugurated a Reform Period. Progress was slowed by the nobles who clung to their privileges.
Count István Széchenyi, the nation's most prominent statesman, recognized the urgent need for modernization. The Hungarian Parliament was reconvened in 1825 to handle financial needs. A liberal party emerged focusing on the peasantry and proclaiming an understanding of the needs of the laborers. Lajos Kossuth emerged as leader of the lower gentry in the Parliament. Habsburg monarchs, desiring an agrarian, traditional Hungary, tried to hinder industrialization. A remarkable upswing started as the nation concentrated on modernization despite Habsburg obstruction of all important liberal laws concerning civil and political rights and economic reforms. These reforms included points such as freedom of the press and the abolition of noble and common noble privileges. Many reformers (such as Lajos Kossuth and Mihály Táncsics) were imprisoned.

### Revolution and war of independence

On 15 March 1848, mass demonstrations in Pest and Buda enabled Hungarian reformists to push through a list of Twelve Demands. The Hungarian Diet took advantage of the Revolutions of 1848 in the Habsburg areas to enact the April Laws, a comprehensive legislative program of dozens of civil rights reforms. Faced with revolution both at home and in Hungary, Austrian Emperor Ferdinand I at first had to accept Hungarian demands. After the Austrian uprising was suppressed, a new emperor Franz Joseph replaced his epileptic uncle Ferdinand. Joseph rejected all reforms and started to arm against Hungary. A year later, in April 1849, an independent government of Hungary was established.
The new government seceded from the Austrian Empire. The Habsburgs were dethroned in the Hungarian part of the Austrian Empire, and the first Republic of Hungary was proclaimed, with Lajos Kossuth as governor and president. The first prime minister was Lajos Batthyány. Joseph and his advisers skillfully manipulated the new nation's ethnic minorities, the Croatian, Serbian and Romanian peasantry, led by priests and officers firmly loyal to the Habsburgs, and induced them to rebel against the new government. The Hungarians were supported by the majority of the Slovaks, Germans, and Rusyns of the country, and almost all the Jews, as well as by many Polish, Austrian and Italian volunteers.
Many members of the non-Hungarian nationalities secured high positions in the Hungarian army, for example General János Damjanich. Initially, Hungarian forces (Honvédség) managed to hold their ground. In July 1849, the Hungarian Parliament proclaimed and enacted the most progressive ethnic and minority rights in the world, but it was too late. To subdue the Hungarian revolution, Joseph had prepared his troops against Hungary and obtained help from Russian Czar Nicholas I. In June, Russian armies invaded Transylvania in concert with Austrian armies marching on Hungary from western fronts on which they had been victorious (Italy, Galicia and Bohemia).
The Russian and Austrian forces overwhelmed the Hungarian army, and General Artúr Görgey surrendered in August 1849. The Austrian marshall Julius Freiherr von Haynau then became governor of Hungary and on 6 October ordered the execution of 13 leaders of the Hungarian army as well as Prime Minister Batthyány; Kossuth escaped into exile. Following the war of 1848–1849, the country sank into "passive resistance". Archduke Albrecht von Habsburg was appointed governor of the Kingdom of Hungary, and this time was remembered for Germanisation.

### Austria-Hungary (1867–1918)

Major military defeats, such as the Battle of Königgrätz in 1866, forced Emperor Joseph to accept internal reforms. To appease Hungarian separatists, the emperor made an equitable deal with Hungary, the Austro-Hungarian Compromise of 1867 negotiated by Ferenc Deák, by which the dual monarchy of Austria-Hungary came into existence. The two realms were governed separately by two parliaments from two capitals, with a common monarch and common foreign and military policies. Economically, the empire was a customs union. The first prime minister of Hungary after the compromise was Count Gyula Andrássy. The old Hungarian constitution was restored, and Franz Joseph was crowned king of Hungary.
In 1868, Hungarian and Croatian assemblies concluded the Croatian–Hungarian Agreement by which Croatia was recognised as an autonomous region.
Austria-Hungary was geographically the second largest country in Europe after Russia. Its territories were appraised at 621,540 square kilometres (239,977 sq mi) in 1905. After Russia and the German Empire, it was the third most populous country in Europe.
In the diet of 1832–36, the conflict between Catholic laymen and clergy sharpened considerably, and a mixed commission offered the Protestants certain limited concessions. The basic issue of this religious and educational struggle was how to promote Magyar language and Magyar nationalism and achieve more independence from German Austria.
The land-owning nobility controlled the villages and monopolized political roles. In Parliament, the magnates held life memberships in the upper house, but the gentry dominated the lower house and, after 1830, parliamentary life. The tension between "crown" and "country" remained a constant political fixture as the Compromise of 1867 enabled the Magyar nobility to run the country, but left the emperor with control over foreign and military policies. However, after Andrássy served as prime minister, he became foreign minister of Austria-Hungary (1871–1879) and set foreign policies with an eye to Hungarian interests. Andrássy was a conservative; his foreign policies looked to expanding the empire into southeast Europe, preferably with British and German support, and without alienating Turkey. He saw Russia as the main adversary and distrusted Slavic nationalist movements. Meanwhile, conflicts between magnates and gentry appeared regarding protection against cheap food imports (in the 1870s), the Church-state problem (in the 1890s), and the "constitutional crisis" (in the 1900s). The gentry gradually lost their power locally and rebuilt their political base more on office-holding rather than land ownership. They depended more on the state apparatus and were reluctant to challenge it.

#### Economy

The era witnessed significant economic development in the rural areas. The formerly backwards Hungarian economy became relatively modern and industrialized by the turn of the 20th century, although agriculture remained dominant in the GDP until 1880. In 1873, the old capital Buda and Óbuda (ancient Buda) were officially merged with the third city, Pest, thus creating the new metropolis of Budapest. Pest grew into the country's administrative, political, economic, trade and cultural hub.
Technological advancement accelerated industrialization and urbanization. The GDP per capita grew roughly 1.45% per year from 1870 to 1913, comparing very favorably to other European nations. The leading industries in this economic expansion were electricity and electro-technology, telecommunications, and transport (especially locomotive, tram and ship construction). The key symbols of industrial progress were the Ganz concern and Tungsram Works. Many of the state institutions and modern administrative systems of Hungary were established during this period.
The census of the Hungarian state in 1910 (excluding Croatia), recorded a population distribution of Hungarian 54.5%, Romanian 16.1%, Slovak 10.7%, and German 10.4%. The religious denomination with the greatest number of adherents was Roman Catholicism (49.3%), followed by Calvinism (14.3%), Greek Orthodoxy (12.8%), Greek Catholicism (11.0%), Lutheranism (7.1%), and Judaism (5.0%)

### World War I

After the assassination of Austrian Archduke Franz Ferdinand in Sarajevo on 28 June 1914, Austria-Hungary declared war on Serbia on 28 July. Austria-Hungary drafted 9 million soldiers in World War I, of which 4 million were from the kingdom of Hungary. Austria-Hungary fought on the side of Germany, Bulgaria and Ottoman Empire—the so-called Central Powers. They occupied Serbia, and Romania declared war. The Central Powers then conquered southern Romania and the Romanian capital of Bucharest. In November 1916, Emperor Franz Joseph died; the new monarch, Emperor Charles I of Austria (IV. Károly), sympathized with the pacifists.
In the east, the Central Powers repelled attacks from the Russian Empire. The Eastern Front of the so-called Entente Powers allied with Russia completely collapsed. Austria-Hungary withdrew from the defeated countries. On the Italian front, the Austro-Hungarian army could not make more successful progress against Italy after January 1918. Despite successes on the Eastern Front, Germany suffered stalemate and eventual defeat on the more determinant Western Front.
By 1918, the economic situation had deteriorated alarmingly in Austria-Hungary; strikes in factories were organized by leftist and pacifist movements, and uprisings in the army had become commonplace. Austria-Hungary signed the Armistice of Villa Giusti in Padua on 3 November 1918. In October 1918, the personal union between Austria and Hungary was dissolved.

### Interwar period (1918–1939)

After the collapse of a short-lived communist regime, according to historian István Deák:
    Between 1919 and 1944 Hungary was a rightist country. Forged out of a counter-revolutionary heritage, its governments advocated a "nationalist Christian" policy; they extolled heroism, faith, and unity; they despised the French Revolution, and they spurned the liberal and socialist ideologies of the 19th century. The governments saw Hungary as a bulwark against bolshevism and bolshevism's instruments: socialism, cosmopolitanism, and Freemasonry. They perpetrated the rule of a small clique of aristocrats, civil servants, and army officers, and surrounded with adulation the head of the state, the counterrevolutionary Admiral Horthy.

#### Revolutions and foreign interventions
##### Hungarian People's Republic

In the aftermath of World War I, while Germany was defeated in 1918 on the Western Front, the Austro-Hungarian monarchy politically collapsed. Former Prime Minister István Tisza was murdered in Budapest during the Aster Revolution of October 1918. On 31 October 1918, the success of this revolution brought the leftist liberal Count Mihály Károlyi to power. On 13 November 1918, Charles I surrendered his powers as king of Hungary; however, he did not abdicate. Károlyi formed a coalition government with the Social Democrats and the Civic Radical Party.
The revolution was relatively bloodless in Budapest, but the returning veterans plunged the countryside into chaos for the following two months. The pacification of these peasant rebellions caused more casualties than the subsequent red and white terrors. Thousands of local Hungarian National Councils were established across the country as a means of provisional administration, often acting semi-independent of the Károlyi government. National Councils of various nationalities (often multiple of one) were also formed to represent their interests.
French Entente troops landed in Greece to re-arm the defeated countries of Romania and Serbia and provide military assistance to the newly formed country of Czechoslovakia. Despite a general armistice agreement, the Balkan French army organized new campaigns against Hungary with the help of the Czechoslovak, Romanian and Serbian governments.
On 5 November 1918, the armed forces of the provisional State of Slovenes, Croats and Serbs, with French support, attacked the southern parts of Kingdom of Hungary. On 8 November, the armed forces of the Czechoslovak Republic attacked northern parts of Kingdom of Hungary. The Treaty of Bucharest that was signed in May 1918 was denounced in October 1918 by the Romanian government, which then re-entered the war on the Allied side and advanced to the Maros (Mureș) river in Transylvania.
Though Austria-Hungary signed an armistice on the Italian front, that did not pertain to Franchet d'Espèrey's Allied Army of the Orient still advanced northwards in the Balkans. Since the Austro-Hungarian Army no longer existed, Károlyi negotiated a separate armistice on behalf of the independent Hungary on 13 November.
The First Hungarian republic was proclaimed on 16 November 1918 with Károlyi named as president. Károlyi tried to build the republic as the "eastern Switzerland" and persuade non-Hungarian minorities to stay loyal to the country, offering them autonomy. However these efforts came too late. In response to Woodrow Wilson's conception of pacifism, Károlyi ordered the full disarmament of the Hungarian army, thus the republic remained without a national defence at a time of particular vulnerability. The emerging surrounding states were not hesitant to arm themselves and attack large parts of the former Eastern Austo-Hungarian empire with the help of the Entente, while there was no agreement yet about their borders.
As a policy, the allies refused to recognize the Austrian and Hungarian successor states. Károlyi's attempts at diplomatic outreach were fruitless. They remained under wartime economic blockade, which contributed to shortages, especially of coal. Though efforts to rebuild the army was made, demoralization, and constant conflict between Pogány's Soldiers' Council and a revolving door of Defense Ministers impeded the process.
Romania re-entered the war on 10 November (one day before Germany's surrender), and invaded Transylvania, reaching the armistice line by mid-December. A separatist movement inspired by Wilson's Fourteen Points proclaimed the unification of Transylvania with Romania. In November the Romanian National Central Council representing all Romanians in Transylvania, notified the Budapest government that it would take control of 23 Transylvanian counties (and parts of 3 others) and requested a Hungarian response by 2 November. The Hungarian government rejected the proposal, claiming that it failed to secure the rights of the ethnic Hungarian population and the German minority.
On 2 December, the Romanian army started to attack the eastern (Transylvanian) parts of the former Austro-Hungarian empire. The Károlyi government had introduced proposals to maintain the integrity of the territory of the former medieval kingdom, but refused to reorganize the Hungarian armed forces. These measures failed to stem popular discontent, especially when the Entente powers began awarding pieces of Hungary's medieval conquests to Romania, Yugoslavia and Czechoslovakia, giving priority to ethno-linguistic criteria over historical ones. French and Serbian forces occupied the southern parts of the former monarchy. In mid-December, Romanian forces crossed the Belgrade armistice line, entering Kolozsvár (Cluj) on 24 December. Their advance halted by mid-January due to allied pressure and increasing Hungarian resistance by the Székely Battalion.
The borders of Czechoslovakia where initially not defined (as it was not an open front, it was outside the scope of the armistice), but from early November, Czech paramilitaries raided into Upper Hungary. To allied pressure, Hungary reached a deal with Slovak politician Milan Hodža to hand over the ethnic Slovak areas on 6 December, then further territories were evacuated by an allied ultimatum issued on 23 December. By then, the Czechoslovak Legions of the Italian Front made their way to their home country, improving their power. On 1 January 1919, Czechoslovak forces entered Pressburg (Hungarian: Pozsony), that would soon be renamed to Bratislava. Carpathian Ruthenia was granted autonomy by Hungary in late December.
Károlyi's domestic policy was centered around two issues, that were long-standing causes in his progressive movement: land redistribution and universal suffrage. Although laws for both causes were enacted, the implementation proved too slow to save Károlyi's reputation. Land redistribution was the principal issue of the majority peasant population, but only small amounts of land was actually redistributed, among them Károlyi's own estates. New voting laws implemented universal male suffrage and female suffrage conditional on literacy tests. However Károlyi was reluctant to hold an election, both because of his waning popularity and because it could have only been held in the un-occupied parts of the country. That meant the government remained without democratic legitimacy. Eventually, an election for April 1919 was scheduled, but it was never held due to the Communist takeover. By February 1919, the new pacifist Hungarian government had lost all popular support. On 21 March 1919, after the Entente military representative demanded more territorial concessions from Hungary, thus Károlyi's political situation became untenable and he resigned. He decided to cede power to the Social Democrats, who in turn formed an alliance with the Communists, declaring the Hungarian Soviet Republic.
By February 1919, the new pacifist Hungarian government had lost all popular support. On 21 March 1919, after the Entente military representative demanded more territorial concessions from Hungary, Károlyi signed all the concessions presented to him and resigned.

##### Hungarian Soviet Republic

The Communist Party of Hungary, led by Béla Kun was a newly-formed party aligned with the Bolsheviks of Soviet Russia. The Social Democrats were split in their relation to them, but on 21 March, the radical faction won out, and the two parties officially merged. They declared the Hungarian Soviet Republic, and the dictatorship of the proletariat. Social Democrat Sándor Garbai was the official head of government, but the Soviet Republic was dominated de facto by Béla Kun, who was in charge of foreign affairs. The communists came to power largely thanks to its organized fighting force (no other major political entity had one of its own), and they promised that Hungary would defend its territory without conscription, possibly with the help of the Soviet Red Army then advancing westwards.
The rejection of their ultimatum did prompt the Paris Peace Conference (the British overruling the French) to send a diplomatic mission to Budapest, but negotiations quickly broke down. On 16 April, Romania resumed its advance against Hungary, joined by Czechoslovak forces on 27 April. By early May, it seemed the Soviet is about to be deposed. But Soviet military and allied diplomatic pressure forced Romania to halt at the River Tisza, while the advance of the Czechoslovak forces was repulsed by a newly organised Red Army of Hungary - a small voluntary army of 53,000 men, most of its soldiers armed factory workers from Budapest. In June 1919, led by its genius strategist Colonel Aurél Stromfeld, the Hungarian Red Army conducted the Northern Campaign, a successful offensive against Czechoslovak forces, recapturing Kassa, and even reaching the Polish border. On the captured territory, the Slovak Soviet Republic was established, although it was mostly a symbolic entity.
From April, sporadic resistance against the Communist was constant, culminating in late June, when a failed coup attempt in Budapest, and a peasant uprising along the lower Danube took place. The support of the communists proved to be short-lived in Budapest, however, and they had never been popular in the countryside. In the aftermath of a coup attempt, the government took a series of actions referred to as the Red Terror, murdering several hundred people (mostly scientists and intellectuals). The Soviet Red Army was never able to aid the Hungarian republic. Despite the great military successes against the Czechoslovak army, the communist leaders gave back all recaptured lands. That attitude demoralized the voluntary army and the Hungarian Red Army soon became dissolved. On 20 July the Red Army launched a new offensive across the Tisza against Romanian troops, but it collapsed within days. The Red Army soon withdrew from these territories on allied demand, promising them in return Romanian withdrawal from the Tisza, which did not occur (as Romania demanded Hungary's demilitarization). This greatly demoralized the Army and caused Stromfeld to resign.
In the face of domestic backlash and an advancing Romanian force in the Hungarian–Romanian War of 1919 and seeing resistance futile, the Communists resigned from power on 1 August. Béla Kun and most of his comrades fled to Austria, and Budapest was occupied on 6 August. Power fell to the moderate wing of the Social Democrats, who refused Romanian armistice terms, and on 6 August, they were deposed by the right-wing István Friedrich, who briefly attempted to name the Habsburg Archduke Joseph August as head of state. All these events, and in particular the final military defeat, led to a deep feeling of dislike among the general population against the Soviet Union (which did not offer military assistance) and the Hungarian Jews (since most members of Kun's government were Jewish).

#### Counterrevolution

During the Soviet Republic, various conservative politicians fled and organised resistance in Vienna (István Bethlen's Antibolsevista Comité), and in French-occupied Szeged (the counter-government of Gyula Károlyi). They were known as counter-revolutionaries – the "Whites", united in their opposition to Károlyi and the Communists, their ideology ranged from Conservative Liberalism, Habsburg Legitimism, to a proto-fascist ideologies sometimes called the Szeged Idea. The Szeged counter-government tasked the former admiral Miklós Horthy to organize a new National Army, while Habsburg royalists established paramilitaries in Styria across the Hungarian border.
In the absence of a strong national police force or regular military forces, a White Terror began in western Hungary by half-regular and half-militarist detachments. Many arrant communists and other leftists were tortured and executed without trial. Radical Whites launched pogroms against the Jews. The most notorious commander of the Whites was Pál Prónay. Over the course of August, Horthy consolidated his position over the paramilitaries, being recognized by the weak government of István Friedrich as "Supreme Warlord".
Hungary was in a state of military anarchy and occupation between August and November 1919. The Paris Peace Conference wished to end the chaos, and establish a stable government that could sign a peace treaty. They placed heavy pressure on Romania to withdraw, and sent George Clerk to Budapest to help establish a functional Hungarian government. The evacuating Romanian army pillaged the country: livestock, machinery and agricultural products were carried to Romania.
On 16 November 1919, as Romanian forces withdrew, the army of right-wing former admiral Miklós Horthy marched into Budapest. His government gradually restored order and stopped terror, but thousands of sympathizers of the Károlyi and Kun regimes were imprisoned.
In January 1920, parliamentary elections were held in Hungarian-controlled territory, on laws similar to that of Károlyi. About 40% of the population, including for the first time women, were eligible to vote. Parliament convened for the first time since the Aster Revolution.
In March 1920, the parliament restored the Hungarian monarchy as a regency but postponed the election of a king until civil disorder had subsided. Instead, Horthy was elected regent and empowered, among other things, to appoint Hungary's prime minister, veto legislation, convene or dissolve the parliament, and command the armed forces. The White Terror continued until late 1920, when radical right-wing paramilitaries were suppressed.

#### Treaty of Trianon

The Paris Peace Conference discussed the question of Hungary's future borders between February and April 1919, and only small modifications were made later. No Hungarian delegation was present at the time - Hungary was only invited on 1 December 1919. That delegation had no power to re-negotiate the established terms, and after several months they signed the peace treaty. Hungary's assent to the Treaty of Trianon on 4 June 1920 ratified the decision of the victorious Entente powers to re-draw the country's borders. The treaty required Hungary to surrender more than two-thirds of its pre-war territories. The goal of this measure was to permit the minority populations of the former Austria-Hungary to reside in states dominated by their own ethnicity, but many Hungarians still lived in such territories. As a result, nearly one third of the 10 million ethnic Hungarians found themselves resident outside their diminished homeland.
New international borders separated Hungary's industrial base from its old sources of raw materials and its former markets. Hungary lost 84% of its timber resources, 43% of its arable land, and 83% of its iron ore. Although Hungary retained 90% of the engineering and printing industry of the former Kingdom of Hungary, only 11% of timber and 16% iron was retained. In addition, 61% of arable land, 74% of public road, 65% of canals, 62% of railroads, 64% of hard surface roads, 83% of pig iron output, 55% of industrial plants, 100% of gold, silver, copper, mercury and salt mines, and most of all, 67% of credit and banking institutions of the former Kingdom of Hungary lay within the territory of Hungary's neighbors.
Irredentism—the demand for return of lost territories—became a central "Maimed Hungary" theme in national politics.

#### The Regency

Horthy appointed Count Pál Teleki as prime minister in July 1920. His government issued a numerus clausus law that limited the admission of nationalities to universities to their proportion in the population (in practice, this targeted the mostly Jews as "political insecure elements" ) and took initial steps towards fulfilling a promise of major land reform by dividing about 3,850 km$^2$ from the largest estates into small holdings in order to quiet rural discontent. Teleki's government resigned, however, after Charles I of Austria, the former emperor of Austria and king of Hungary, attempted unsuccessfully to retake Hungary's throne in March 1921. The attempt split conservative politicians who favored a Habsburg restoration and nationalist right-wing radicals who supported the election of a native Hungarian king. Count István Bethlen took advantage of this rift to form a new Party of Unity under his leadership. Horthy then appointed Bethlen prime minister. Charles failed to reclaim the throne a second time in October 1921, this time by military force. In response he was exiled to Madeira where he soon died, and the Habsburgs were officially dethroned.
In the same time, conflict erupted between Austria and Hungary over the handover of Burgenland. Paramilitaries led by Prónay repulsed the arriving Austrians and established an independent Lajtabánság. In exchange to end support for the paramilitaries, Austria agreed a referendum be held in the city of Sopron. The city and eight surrounding settlements voted to remain in Hungary, while Austria took over the rest of Őrvidék, which was renamed to Burgenland in 1922.
Prime Minister Bethlen dominated Hungarian politics between 1921 and 1931. He fashioned a political machine by amending the electoral law, providing jobs in the expanding bureaucracy to his supporters, and manipulating elections in rural areas. Bethlen restored order to the country by giving the radical counter-revolutionaries payoffs and government jobs in exchange for ceasing their campaign of terror against Jews and leftists.
In 1921, Bethlen made a deal with the Social Democrats and trade unions (called the Bethlen-Peyer Pact) to legalize their activities and free political prisoners in return for their pledge to refrain from spreading anti-Hungarian propaganda, calling political strikes, and attempting to organize the peasantry. Bethlen brought Hungary into the League of Nations in 1922 and signed a treaty of friendship with Italy in 1927. Overall, Bethlen sought to pursue a strategy of strengthening the economy and building relations with stronger nations. Irredentism, the revision of the Treaty of Trianon, rose to the top of Hungary's political agenda. Revision of the treaty had such a broad backing in Hungary that Bethlen used it, at least in part, to deflect criticism of his economic, social and political policies.
The worldwide Great Depression that began in 1929 induced a drop in the standard of living and the political mood of the country shifted further towards the right. In 1932, Horthy appointed Gyula Gömbös as prime minister, who changed the course of Hungarian policy towards closer cooperation with Germany and started an effort to Magyarize the few remaining ethnic minorities in Hungary.
Gömbös signed a trade agreement with Germany that helped Hungary's economy out of depression but made Hungary dependent on the German economy. Adolf Hitler appealed to Hungarian desires for territorial revisionism, while extreme right-wing organizations such as the Arrow Cross Party increasingly embraced extreme Nazi policies. They sought the suppression and victimization of Jews. The government passed the First Jewish Law in 1938: the law established a quota system to limit Jewish involvement in the economy.
In 1938, Béla Imrédy became prime minister. Imrédy's attempts to improve Hungary's diplomatic relations with the United Kingdom initially made him very unpopular in Germany and Italy. In light of Germany's Anschluss with Austria in March, he realized that he could not afford to alienate Germany and Italy. In the autumn of 1938, his foreign policy became very much pro-German and pro-Italian.
Intent on amassing a base of power in Hungarian right wing politics, Imrédy began to suppress political rivals. The increasingly influential Arrow Cross Party was harassed and eventually banned. As Imrédy drifted further to the right, he proposed that the government be re-organized along totalitarian lines and drafted a harsher Second Jewish Law which greatly restricted Jewish involvement in the economy, culture and society and, significantly, defined Jews by race instead of religion. This definition significantly and negatively altered the status of those who had formerly converted from Judaism to Christianity.

### World War II

During World War II, the Kingdom of Hungary was a member of the Axis powers. Nazi Germany and Fascist Italy sought to enforce the claims of Hungarians living in territories Hungary lost in 1920 with the signing of the Treaty of Trianon, and the two Vienna Awards returned parts from Czechoslovakia and Romania to Hungary. During the 1930s, the Kingdom of Hungary relied on increased trade with Fascist Italy. This was important at the time because Hungary's foreign debt enlarged as Bethlen expanded the bureaucracy to absorb the university graduates who, if left idle, might have threatened the civil order. The 1939 annexation of the remainder or Carpathian Ruthenia was an own action initiated by Hungary after the breakup of Czechoslovakia.
On 1 September 1939, Nazi Germany invaded Poland and started the Second World War. On 20 November 1940, under pressure from Germany, Teleki affiliated Hungary with the Tripartite Pact. In December 1940, he also signed an ephemeral "Treaty of Eternal Friendship" with Yugoslavia. A few months later, after a Yugoslavian coup threatened the success of the planned German invasion of the Soviet Union, Hitler asked the Hungarians to support his invasion of Yugoslavia. He promised to return some former Hungarian territories lost after World War I in exchange for cooperation. Teleki committed suicide and the right-wing radical László Bárdossy succeeded him as prime minister. Following the Invasion of Yugoslavia and the proclamation of the Independent State of Croatia, Hungary annexed Bácska, the remainder of Baranya, Muravidék and Muraköz.
Hungarian participation in Operation Barbarossa during 1941 was limited in part because the country had no large army before 1939, and the time to prepare, train and equip troops was short. After war against Russia broke out on the Eastern Front in 1941, many Hungarian officials argued for participation in the war on the German side so as not to encourage Hitler into favoring Romania in the event of border revisions in Transylvania. Hungary entered the war and on 1 July 1941, at the direction of the Germans, the Hungarian Karpat Group advanced far into southern Russia. At the Battle of Uman, the Gyorshadtest participated in the encirclement of the 6th Soviet Army and the 12th Soviet Army.
Worried about Hungary's increasing reliance on Germany, Admiral Horthy forced Bárdossy to resign and replaced him with Miklós Kállay. Kállay continued Bárdossy's policy of supporting Germany against the Red Army, while he also surreptitiously entered into negotiations with the Western Powers.
In late 1941, the Hungarian army participated in the invasion of Yugoslavia and the invasion of the Soviet Union. Poland quickly collapsed, and Hungary allowed 70,000 Polish refugees to enter, much to Hitler's annoyance. During the Battle of Stalingrad, the Hungarian Second Army suffered terrible losses. Shortly after the fall of Stalingrad in January 1943, the Hungarian Second Army effectively ceased to exist as a functioning military unit.
Secret negotiations with the British and Americans continued. Aware of Kállay's deceit and fearing that Hungary might conclude a separate peace, Hitler ordered Nazi troops to launch Operation Margarethe and occupy Hungary in March 1944. Döme Sztójay, an avid supporter of the Nazis, became the new prime minister with the aid of a Nazi military governor, Edmund Veesenmayer. SS Colonel Adolf Eichmann went to Hungary to oversee the large-scale deportations of Jews to German death camps. Between 15 May and 9 July 1944, the Hungarians deported 437,402 Jews to the Auschwitz concentration camp. In August 1944, Horthy replaced Sztójay with the anti-Fascist General Géza Lakatos. Under the Lakatos regime, the acting Interior Minister Béla Horváth ordered Hungarian gendarmes to prevent any Hungarian citizens from being deported.
In September 1944, Soviet forces crossed the Hungarian border. On 15 October 1944, Horthy announced that Hungary had signed an armistice with the Soviet Union. The Hungarian army ignored the armistice. The Germans launched Operation Panzerfaust and, by kidnapping his son (Miklós Horthy Jr.), forced Horthy to abrogate the armistice, depose the Lakatos government, and name the leader of the Arrow Cross Party, Ferenc Szálasi, as prime minister. Szálasi became prime minister of a new fascist Government of National Unity and Horthy abdicated. The retreating German army demolished the rail, road, and communications systems.
On 28 December 1944, a provisional government was formed in Hungary under acting Prime Minister Béla Miklós. Miklós and Szálasi's rival governments each claimed legitimacy and the territory effectively controlled by the Arrow Cross regime shrunk gradually. The Red Army completed the encirclement of Budapest on 29 December 1944 and the siege of Budapest continued into February 1945. Most of what remained of the Hungarian First Army was destroyed north of Budapest between 1 January and 16 February 1945. Budapest unconditionally surrendered to the Soviet Red Army on 13 February 1945. On 20 January 1945, representatives of the Hungarian provisional government signed an armistice in Moscow. Szálasi's government fled the country. Officially, Soviet operations in Hungary ended on 4 April 1945, when the last German troops were expelled.
The era was characterized by growing anti-Semitism, which was also supported at the level of state politics, leading to the violent deaths of more than 400,000 Jews from 1941 to 1945. The war took many lives among the population, the most devastating was the siege of Budapest. There were about half a million civilian and military victims of World War II in Hungary, in addition to the hundreds of thousands killed in death camps. The country's infrastructure was severely damaged, and most of the national wealth was taken by the Germans and the Soviets. All the recaptured territories were also lost, and the Hungarian civilian population then lost even more people, who suffered the return of the attacks in neighboring countries in Slovakia, Transcarpathia, and especially in Vojvodina from deportation and massacres.
Following the Paris Peace Treaty of 1947, Hungary had an area smaller than the Trianon borders, and the Czechoslovak delegation succeeded in removing the Bratislava bridgehead from the country. The country, plagued by looting and inflation, was then ordered to pay $300 million in damages.
As regards Hungary's World War II casualties, Tamás Stark of the Hungarian Academy of Sciences calculated military losses at 300,000–310,000, including 110–120,000 killed in battle and 200,000 missing in action and prisoners of war in the Soviet Union. Hungarian military losses include 110,000 men who were conscripted from the annexed territories of Greater Hungary in Slovakia, Romania and Yugoslavia and the deaths of 20,000–25,000 Jews conscripted for army labor units. Civilian losses of about 80,000 include 45,500 killed in the 1944–1945 military campaign and in air attacks, and the genocide of Romani people of 28,000 persons. Jewish Holocaust victims totaled 600,000 (300,000 in the territories annexed between in 1938 and 1941, 200,000 in the pre-1938 countryside and 100,000 in Budapest).

### Post-war communist period
#### Transition to communism (1944–1949)

The Soviet Army occupied Hungary from September 1944 until April 1945. The siege of Budapest lasted almost two months, from December 1944 to February 1945 (the longest successful siege of any city in the entire war, including Berlin), and the city suffered widespread destruction, including the demolition of all the Danube bridges. In Moscow in November 1944, Hungarian officials led by Miklós met with exiled communists and agreed on a postwar government. Miklós would be premier, and the Communist Party would be legalized and join the government. The provisional national government formed on 22 December 1944 in Debrecen, which was under Soviet control. It reorganized the public sector, began land reform, modernized elementary education, and called for elections.
By signing the Peace Treaty of Paris of 1947, Hungary again lost all the territories that it had gained between 1938 and 1941. Neither the Western Allies nor the Soviet Union supported any change in Hungary's pre-1938 borders, except three more villages to be transferred to the recreated Czechoslovakia (Horvátjárfalu, Oroszvár, and Dunacsúny). The Soviet Union annexed sub-Carpathia (before 1938 the eastern edge of Czechoslovakia).
The Treaty of Peace with Hungary signed on 10 February 1947 declared that, "The decisions of the Vienna Award of November 2, 1938, are declared null and void", and Hungarian boundaries were fixed along the former frontiers as they existed on 1 January 1938 except for a minor loss of territory on the Czechoslovakian border. Many of the communist leaders of 1919 returned from Moscow. The first major violation of civil rights was suffered by the ethnic German minority, half of which (240,000 people) were deported to Germany in 1946–1948. There was a forced "exchange of population" between Hungary and Czechoslovakia, which involved about 70,000 Hungarians living in Slovakia and somewhat smaller numbers of ethnic Slovaks living in the territory of Hungary.
The Soviets originally planned for a piecemeal introduction of the communist regime in Hungary, therefore when they set up a provisional government in Debrecen on 21 December 1944, they were careful to include representatives of several moderate parties. Following the demands of the Western Allies for a democratic election, the Soviets authorized the only essentially free election held in post-war eastern Europe in Hungary in November 1945. This was also the first election held in Hungary on the basis of universal franchise.
People voted for party lists, not for individual candidates. The Independent Smallholders' Party, a center-right peasant party, won 57% of the vote. Despite the hopes of the communists and the Soviets that the distribution of the aristocratic estates among the poor peasants would increase their popularity, the Hungarian Communist Party received only 17% of the votes. The Soviet commander in Hungary, Marshal Voroshilov, refused to allow the Smallholders' Party to form a government on their own. Under Voroshilov's pressure, the Smallholders organized a coalition government including the communists, the social democrats and the National Peasant Party (a left-wing peasant party), in which the communists held some of the key posts. On 1 February 1946 Hungary was declared a republic, and the leader of the Smallholders, Zoltán Tildy, became president. He handed over the office of prime minister to Ferenc Nagy. Mátyás Rákosi, leader of the Communist Party, became deputy prime minister. Another leading communist, László Rajk, became minister of the interior responsible for controlling law enforcement and established the Hungarian security police (ÁVH). The communists exercised constant pressure on the Smallholders. They nationalized industrial companies, banned religious civil organizations and occupied key positions in local public administration. In February 1947, the police began arresting leaders of the Smallholders Party, charging them with "conspiracy against the republic". Several prominent figures decided to emigrate or were forced to escape abroad, including Prime Minister Nagy in May 1947.
At the parliamentary election in August 1947, the communists committed widespread election fraud but even so, they only managed to increase their share from 17% to 24% in Parliament. The Smallholders' Party lost much of its popularity and ended up with 15%, but their former voters turned towards three new center-right parties which seemed more determined to resist the communist onslaught: their combined share of the total votes was 35%.
Faced with their second failure at the polls, the communists changed tactics, and, under new orders from Moscow, decided to eschew democratic facades and speed up the communist takeover. In June 1948, the Social Democratic Party was forced to merge with the Communist Party to create the Hungarian Working People's Party, which was dominated by the communists. Anti-communist leaders of the social democrats, such as Károly Peyer and Anna Kéthly, were forced into exile or excluded from the party. Soon after, President Tildy was removed from his position and replaced by a fully cooperative social democrat, Árpád Szakasits.
Ultimately, all parties were organized into a coalition called the People's Front in February 1949, thereby losing even the vestiges of their autonomy. The leader of the People's Front was Rákosi. Opposition parties were declared illegal and their leaders arrested or forced into exile. On 18 August 1949, the parliament passed the Hungarian Constitution of 1949, which was modeled after the 1936 constitution of the Soviet Union. The name of the country changed to the People's Republic of Hungary, "the country of the workers and peasants" where "every authority is held by the working people". Socialism was declared to be the main goal of the nation. A new coat-of-arms was adopted with communist symbols such the red star, hammer and sickle.

#### Stalinist era (1949–1956)

Rákosi, who as a chief secretary of the Hungarian Working People's Party was de facto the leader of Hungary, possessed practically unlimited power and demanded complete obedience from fellow members of the party, including his two most trusted colleagues, Ernő Gerő and Mihály Farkas. All three of them returned to Hungary from Moscow, where they had close ties to high-ranking Soviet leaders. Their main rivals in the party were the "Hungarian" communists who led the illegal party during the war and were considerably more popular within party ranks.
Rajk, their most influential leader, was arrested in May 1949. He was accused of spying for Western imperialist powers and Yugoslavia. At his trial in September 1949, he made a forced confession to be an agent of Horthy, Leon Trotsky, Josip Broz Tito and Western imperialism. Rajk was found guilty and executed. In the next three years, other leaders of the party deemed untrustworthy were also imprisoned on similar charges.
The show trial of Rajk is considered the beginning of the worst period of the Rákosi dictatorship. Rákosi attempted to impose totalitarian rule on Hungary. The centrally orchestrated personality cult focused on him and Joseph Stalin soon reached unprecedented proportions. Rákosi's images and busts were everywhere, and all public speakers were required to glorify his wisdom and leadership. In the meantime, the secret police, led through Gábor Péter by Rákosi, mercilessly persecuted all "class enemies" and "enemies of the people".
An estimated 2,000 people were executed and over 100,000 were imprisoned. Some 44,000 ended up in forced-labor camps, where many died from the horrible work conditions, poor food and lack of medical care. Another 15,000 people—mostly former aristocrats, industrialists, military generals and other upper-class people—were deported from the capital and other cities to countryside villages where they were forced to perform hard agricultural labor. These policies were opposed by some members of the Hungarian Working People's Party, and around 200,000 were expelled by Rákosi from the organization.

##### Nationalization

By 1950, the state controlled most of the economy, as all large and mid-sized industrial companies, plants, mines, banks of all kind as well as all companies of retail and foreign trade were nationalized without any compensation. Following Soviet economic policies, Rákosi declared that Hungary would become a "country of iron and steel" even though Hungary lacked iron ore completely. The forced development of heavy industry served military purposes. A disproportionate amount of the country's resources were spent on building whole new industrial cities and plants from scratch, while much of the country was still in ruins since the war. Traditional strengths of Hungary, such as the agricultural and textile industries, were neglected.
Large agricultural latifundia were divided and distributed among poor peasants already in 1945. In agriculture, the government forced independent peasants to enter cooperatives in which they would become paid laborers, and many of them stubbornly resisted, while the government retaliated with higher food quotas imposed on peasants' produce. Rich peasants, called 'kulaks' in Russian, were declared "class enemies" and suffered sanctions. With them, some of the most able farmers were removed from production. The declining agricultural output led to a constant scarcity of food, especially meat.
Rákosi rapidly expanded the education system in Hungary. This was an attempt to replace the educated class of the past by what Rákosi called a new "working intelligentsia". In addition to effects such as better education for the poor, more opportunities for working class children and increased literacy in general, this measure also included the dissemination of communist ideology in schools and universities. Also, as part of efforts at separation of church and state, practically all religious schools were taken into state ownership, and religious education was denounced as retrograde propaganda and gradually eliminated from schools.
Cardinal József Mindszenty was arrested in December 1948 and accused of treason. After five weeks under arrest (which included torture), he confessed to the charges against him and was sentenced to life imprisonment. The Protestant and Catholic churches were also purged, and their leaders were replaced by those willing to remain loyal to Rákosi's government.
The Hungarian military hastily staged public trials to purge "Nazi remnants and imperialist saboteurs". Several officers were sentenced to death and executed in 1951, including Lajos Toth, a distinguished fighter ace of World War II. The victims were cleared posthumously following the overthrow of communism.

##### Rivalry between communist leaders

Rákosi's priorities for the economy were developing military industry and heavy industry and providing the Soviet Union with war compensation. Improving standards of living were not a priority, and for this reason the people of Hungary saw living standards fall. Although his government became increasingly unpopular, he had a firm grip on power until Stalin died on 5 March 1953 and a confused power struggle began in Moscow. Some of the Soviet leaders perceived the unpopularity of the Hungarian regime and ordered Rákosi to give up his position as prime minister in favor of another former communist-in-exile in Moscow, Imre Nagy, who was Rákosi's chief opponent in the party. Rákosi, however, retained his position as general secretary of the Hungarian Working People's Party, and over the next three years the two men became involved in a bitter struggle for power.
As Hungary's prime minister, Nagy slightly relaxed state control over the economy and the mass media and encouraged public discussion on political and economic reform. In order to improve general living standards, he increased the production and distribution of consumer goods and reduced the tax and quota burdens of the peasants. Nagy also closed forced-labor camps, released most of the political prisoners and reined in the secret police, whose hated head Gábor Péter was convicted and imprisoned in 1954. All these rather moderate reforms earned him widespread popularity in the country, especially among the peasantry and the left-wing intellectuals.
Following a turn in Moscow, where Georgy Malenkov, Nagy's primary patron, lost the power struggle against Nikita Khrushchev, Rákosi started a counterattack on Nagy. On 9 March 1955, the central committee of the Hungarian Working People's Party condemned Nagy for "rightist deviation", and Nagy was accused of being responsible for the country's economic problems. On 18 April, he was dismissed from his post by a unanimous vote of the National Assembly. Rákosi once again became the unchallenged leader of Hungary.
Rákosi's second reign, however, did not last long. His power was undermined by a speech made by Khrushchev in February 1956, in which he denounced the policies of Stalin and his followers in eastern Europe. On 18 July 1956, visiting Soviet leaders removed Rákosi from all his positions, and he boarded a plane bound for the Soviet Union. But the Soviets made a major mistake by the appointment of his close friend and ally Gerő as his successor, who was equally unpopular and shared responsibility for most of Rákosi's crimes.
The fall of Rákosi was followed by a flurry of reform agitation both inside and outside the party. Rajk and his fellow victims of the showcase trial of 1949 were cleared of all charges, and on 6 October 1956, the party authorized a reburial, which was attended by tens of thousands of people and became a silent demonstration against the crimes of the regime. On 13 October, it was announced that Nagy had been re-instated as a member of the party.

#### 1956 revolution

On 23 October 1956, a peaceful student demonstration in Budapest produced a list of 16 Demands of Hungarians Revolutionaries for reform and greater political freedom. As the students attempted to broadcast these demands, the State Protection Authority made some arrests and tried to disperse the crowd with tear gas. When the students attempted to free those arrested, the police opened fire, setting off a chain of events which led to the Hungarian Revolution of 1956.
Commissioned officers and soldiers joined the students on the streets of Budapest and Stalin's statue was brought down. The central committee of the Hungarian Working People's Party responded to these developments by requesting Soviet military intervention and deciding that Nagy should become head of a new government. Soviet tanks entered Budapest in the early morning of 24 October. On 25 October, Soviet tanks opened fire on protesters in Parliament Square. Shocked by these events, the central committee of the Hungarian Working People's Party forced Gerő to resign from office and replaced him with Kádár.
Nagy went on Radio Kossuth and announced he had taken over the leadership of the government as chairman of the Council of Ministers. He also promised "the far-reaching democratization of Hungarian public life, the realization of a Hungarian road to socialism in accord with our own national characteristics, and the realization of our lofty national aim: the radical improvement of the workers' living conditions." On 28 October, Nagy and a group of his supporters, including Kádár, Géza Losonczy, Antal Apró, Károly Kiss, Ferenc Münnich and Zoltán Szabó, managed to take control of the Hungarian Working People's Party. At the same time, revolutionary workers' councils and local national committees were formed all over Hungary.
The change of leadership in the party was reflected in the articles of the government newspaper Szabad Nép ("Free People"). On 29 October the newspaper welcomed the new government and openly criticized Soviet attempts to influence the political situation in Hungary. On 30 October, Nagy announced that he was freeing Cardinal Mindszenty and other political prisoners. He also informed the people that his government intended to abolish the one-party state. This was followed by statements of Tildy, Kéthly and Farkas concerning the restitution of the Smallholders Party, the Social Democratic Party and the Petőfi (former Peasants) Party.
Nagy's most controversial decision took place on 1 November, when he announced that Hungary intended to withdraw from the Warsaw Pact and proclaimed Hungarian neutrality. He asked the United Nations to become involved in the country's dispute with the Soviet Union. On 3 November, Nagy announced details of his coalition government. It included communists (Kádár, Georg Lukács, and Géza Losonczy), three members of the Smallholders' Party (Tildy, Béla Kovács and István Szabó), three Social Democrats (Kéthly, Gyula Keleman, Joseph Fischer), and two Petőfi Peasants (István Bibó and Farkas). Pál Maléter was appointed minister of defence.
Khrushchev became increasingly concerned about these developments and on 4 November 1956 sent the Red Army into Hungary. Soviet tanks immediately captured Hungary's airfields, highway junctions and bridges. Fighting took place all over the country, and the Hungarian forces were quickly defeated. During the Hungarian Uprising, an estimated 20,000 people were killed, nearly all during the Soviet intervention. Nagy was arrested and imprisoned until his execution in 1958. Other government ministers or supporters who were either executed or died in captivity include Maléter, Losonczy, Attila Szigethy and Miklós Gimes.

#### Post-revolution Kádár era (1956–1989)

Once he was in power, Kádár led an attack against revolutionaries. 21,600 mavericks (democrats, liberals, and reformist communists alike) were imprisoned, 13,000 interned, and 400 killed. But in the early 1960s, Kádár announced a new policy under the motto of "He who is not against us is with us", a modification of Rákosi's statement, "He who is not with us is against us". He declared a general amnesty, gradually curbed some of the excesses of the secret police, and introduced a relatively liberal cultural and economic course aimed at overcoming the post-1956 hostility towards him and his regime.
In 1966, the central committee approved the "New Economic Mechanism", through which it sought to rebuild the economy, increase productivity, make Hungary more competitive in world markets, and create prosperity to ensure political stability. Over the next two decades of relative domestic quiet, Kádár's government responded alternately to pressures for minor political and economic reforms as well as to counter-pressures from reform opponents. By the early 1980s, it had achieved some lasting economic reforms and limited political liberalization and pursued a foreign policy that encouraged more trade with the West. Nevertheless, the New Economic Mechanism led to mounting foreign debt that was incurred in order to shore up unprofitable industries.
Hungary's transition to a Western-style democracy was one of the smoothest among the former Soviet bloc. By late 1988, activists within the party and bureaucracy and Budapest-based intellectuals were increasing pressure for change. Some of these became reform socialists, while others began movements which were to develop into parties. Young liberals formed the Federation of Young Democrats (Fidesz); a core from the so-called democratic opposition formed the Alliance of Free Democrats (SZDSZ), and the national opposition established the Hungarian Democratic Forum (MDF). Civic activism intensified to a level not seen since the 1956 revolution.

##### End of communism

In 1988, Kádár was replaced as general secretary of the Communist Party, and reform communist leader Imre Pozsgay was admitted to the politburo. In 1989, the Parliament adopted a "democracy package" that included trade-union pluralism; freedom of association, assembly, and the press; a new electoral law; and in October 1989 a radical revision of the constitution, among others. Since then, Hungary has reformed its economy and increased its connections with western Europe. It became a member of the European Union in 2004.
A central committee plenum in February 1989 endorsed in principle the multiparty political system and the characterisation of the October 1956 revolution as a "popular uprising", in the words of Pozsgay, whose reform movement had been gathering strength as Communist Party membership declined dramatically. Kádár's major political rivals then cooperated to move the country gradually to democracy. The Soviet Union reduced its involvement by signing an agreement in April 1989 to withdraw Soviet forces by June 1991.
National unity culminated in June 1989 as the country re-buried Nagy, his associates, and, symbolically, all other victims of the 1956 revolution. A Hungarian National Round Table, comprising representatives of the new parties and some re-created old parties (such as the Smallholders and Social Democrats), the Communist Party, and different social groups, met in late summer 1989 to discuss major changes to the Hungarian constitution in preparation for free elections and the transition to a fully free and democratic political system.
In October 1989, the Communist Party convened its last congress and re-established itself as the Hungarian Socialist Party. In a historic session on 16–20 October 1989, the Parliament adopted legislation providing for multi-party parliamentary elections and a direct presidential election. The legislation transformed Hungary from a People's Republic into the Republic of Hungary, guaranteed human and civil rights, and created an institutional structure that ensures separation of powers among the judicial, executive, and legislative branches of government. On the anniversary of the 1956 Revolution, 23 October, the Hungarian Republic was officially declared by the provisional President, Mátyás Szűrös. The revised constitution also championed the "values of bourgeois democracy and democratic socialism" and gave equal status to public and private property.

### Third Republic (since 1989)
#### Foundation

The first free parliamentary election, held in May 1990, was effectively a plebiscite on communism. The revitalized and reformed communists performed poorly. Populist, center-right, and liberal parties fared best, with the MDF winning 43% of the vote and the SZDSZ capturing 24%. Under Prime Minister József Antall, the MDF formed a center-right coalition government with the Independent Smallholders' Party and the Christian Democratic People's Party to command a 60% majority in the parliament.
By June 1991, the Soviet troops ("Southern Army Group") left Hungary. The total number of Soviet military and civilian personnel stationed in Hungary was around 100,000, having at their disposal approximately 27,000 military equipment. The withdrawal was performed with 35,000 railway cars. The last units commanded by general Viktor Silov crossed the Hungarian-Ukrainian border at Záhony-Chop.
Péter Boross succeeded as prime minister after Antall died in December 1993. The Antall/Boross coalition governments struggled to create a reasonably well-functioning parliamentary democracy in a market-economy, and to manage the related political, social and economic crises resulting from the collapse of the former Communist system. The massive decline in living standards led to a massive loss of political support.
In the May 1994 election, the Socialists won a plurality of votes and 54% of the seats (with the new Prime Minister, Gyula Horn) after a campaign focused largely on economic issues and the substantial decline in living standards since 1990. This signaled a wish to turn back to the relative security and stability of the socialist era, but voters rejected both right and left-wing extremist solutions. After its disappointing result in the election, leadership of the Fidesz party opted for an ideological shift from a liberal to a conservative party. This caused a severe split in the membership and many members left for the other liberal party, the SZDSZ, which formed a coalition with the socialists, leading to a more than two-thirds majority.

#### Economic reform

The coalition was influenced by the socialism of Horn, by the economic focus of its technocrats (who had been Western-educated in the 1970s and 1980s) and ex-cadre entrepreneur supporters, and by its liberal coalition partner the SZDSZ. Facing the threat of state bankruptcy, Horn initiated economic reforms and aggressive privatization of state enterprises to multinational companies in return for expectations of investment (in the form of reconstruction, expansion and modernization). The socialist-liberal government adopted a fiscal austerity program, the Bokros package in 1995, which had dramatic consequences for social stability and quality of life. The government introduced post-secondary tuition fees, partially privatized state services, but supported science both directly and indirectly, through the private sector. The government pursued a foreign policy of integration with Euro-Atlantic institutions and reconciliation with neighboring countries. Critics argued that the policies of the ruling coalition were more right-wing than those of the previous right-wing government had been.
The Bokros package and efforts at privatizations were unpopular with voters, as were rising crime rates, allegations of government corruption, and an attempt to restart the unpopular program of building a dam on the Danube. This dissatisfaction among voters resulted in a change of government following the 1998 parliamentary elections.
After a disappointing result in the 1994 elections, Fidesz under the presidency of Viktor Orbán had changed its political position from liberal to national conservative, adding "Hungarian Civic Party" (Magyar Polgári Párt) to its shortened name. The conservative turn caused a severe split in the membership. Péter Molnár left the party, as well as Gábor Fodor and Klára Ungár, who joined the SZDSZ. Orbán's Fidesz party gained the plurality of parliamentary seats in the 1998 election and forged a coalition with the Smallholders and the Democratic Forum.

#### First cabinet of Viktor Orbán: 1998–2002

The government led by Orbán promised to stimulate faster growth, curb inflation, and lower taxes. It inherited an economy with positive economic indicators, including a growing export-surplus. The government abolished tuition fees and aimed to create good market conditions for small businesses and to encourage local production with domestic resources. In terms of foreign policy, the Orbán administration continued to pursue Euro-Atlantic integration as its first priority but was a more vocal advocate of minority rights for ethnic Hungarians abroad than the previous government had been. As a result of a 1997 referendum, Hungary joined NATO in 1999. In 2002, the European Union agreed to admit Hungary along with 9 other countries as members on 1 January 2004.
Fidesz was criticized by its adversaries for the party's presentation of history, particularly the 1989 fall of communism. While Fidesz had suggested that the Socialist party is the moral and legal successor to the hated state party of the Communist past, the socialists would assert that they had been those who had pushed for change from within, derided Fidesz members for crediting themselves as the sole creators and heirs of the fall of communism.
In the 2002 election the MSZP/SZDSZ left-wing coalition narrowly beat the Fidesz/MDF right-wing coalition in a fierce political fight, with record-high 73% voter turnout. Péter Medgyessy became prime minister.

#### MSZP: 2002–2010

Under the socialist-liberal government, the economic balance of the Hungarian economy started a free fall, while quality of life, infrastructure and technology improved. On 1 May 2004 Hungary became a member of the EU. In the elections of April 2006, Hungary decided to re-elect its government for the first time since 1989, though with Prime Minister Ferenc Gyurcsány. The government presented plans to reach balance and sustainable economic growth by removing subsidies to the growth of standard of living, which it had not mentioned during its electoral campaign. A leaked speech was followed by mass protests against the Gyurcsány government between 17 September and 23 October 2006. It was the first sustained protest in Hungary since 1989. From 2007, when increased inflation caused by tax increases reduced the standard of living, a complete restructuring of the state administration, energy sector, relations with private business, health sector and social welfare took place. Members of affected professional unions describe the measures as lacking discussion and uncompromising. The country joined the Schengen Area at the end of 2007. In 2008, the coalition broke up over the disagreement whether the insurance side of the health sector should be state-owned and its policies decided by the state (as preferred by the Socialists) or by private companies (as preferred by the Liberals). This conflict was followed by a successful public referendum, initiated by Fidesz, calling for the abolition of university tuition fees, direct payments by insured patients on receiving medical attention, and daily fees at hospital by insured patients. This effectively stopped the restructuring of health care, while it remained completely publicly owned. Because of this the liberals left the coalition, and from then on the socialists governed as a minority.
The 2008 financial crisis caused further budgetary constraints. After Gyurcsány's resignation, the socialists put forward a "government of experts" under Gordon Bajnai in March 2009, which would only make essential macroeconomic decisions.

#### Orbán governments: 2010–

Fidesz regained power in the 2010 Hungarian parliamentary election in a landslide, winning two-thirds of the seats in Parliament. In the autumn municipal elections, Fidesz achieved a majority in almost all local and mayoral elections, winning the traditional strongholds of the liberal parties. This started the System of National Cooperation (NER). The Second Orbán Government promulgated the new Constitution of Hungary, adopted in 2011 and in force since 1 January 2012. The main goal of the government was to restart economic growth. It introduced a flat tax system for income tax at 16% for everyone.
After the new constitution came into effect, Orbán, according to his critics, gradually consolidated power and began the process of making Hungary less democratic. Orbán referred to Hungary as an "illiberal state". Orbán discarded the idea of welfare state, stating that the Hungarian economy must be workfare based. By 2014, significant improvements were made in decreasing unemployment (from 11.4% in 2010), to 7.1% in 2014, and generating economic growth (reaching 3.5% in 2014, the top value among EU member states); the growth has been very unequal: the wealth of the top 20% of the society grew significantly, while the ratio of people living below poverty line increased from 33% in 2010 to 40% in 2014. The government centralized the education system, and started a multiple-year-long program for increasing the salaries of teachers and health professionals. In the 2014 Hungarian parliamentary election, Fidesz again won a supermajority but only by a one-MP margin. In February 2015, a by-election was held in the city of Veszprém, where an opposition-nominated MP was elected, thus Fidesz lost its supermajority.
Under the Third Orbán Government, the 2015 European migrant crisis affected Hungary as one of the countries with a southern external border of the European Union. The government erected the Hungarian border barrier along its border with Serbia and Croatia in summer 2015. Attempts by migrants to cross the barrier using force were met with riot police in September 2015, and the barrier was reinforced in 2016.
The EU's Justice and Home Affairs Council approved a migrant quota plan. Following the decision, Hungary and Slovakia took legal action over EU's mandatory migrant quotas at the European Court of Justice in Luxembourg City. The government also called for the 2016 Hungarian migrant quota referendum in October. While an overwhelming majority (98%) of those voting rejected the EU's migrant quotas, voter turnout at 44% was below the 50%, which would have been required for the referendum to be considered valid.
In the 2018 Hungarian parliamentary election, Fidesz–KDNP again won a supermajority, with no change in the numbers of seats held from the previous election. The Fourth Orbán Government was formed on 18 May 2018. In October 2019, the opposition won the mayoral election in the capital, Budapest, meaning Prime Minister Orbán and the Fidesz–KDNP governing coalition got their first major electoral blow since 2006.
In March 2022, the Hungarian parliament chose Katalin Novák, a close ally of Orbán, as the first female President of Hungary for the mainly ceremonial post. In the 2022 Hungarian parliamentary election a month later, Orbán won a fourth consecutive term in office. Fidesz secured another two-thirds majority in parliament.
In September 2022, the Ninth European Parliament passed a resolution saying Hungary is an electoral autocracy and can no longer be considered a full democracy. Relations between Hungary and its Western partners have strained, because Orban's government has maintained relations with Russia despite sanctions against Russia after the 2022 Russian invasion of Ukraine.
On 26 February 2024, Hungary's parliament elected Tamas Sulyok as the new President of Hungary, following to the resignation of his predecessor.

## Historiography

In the 1920s historians with a sense of national mission urgently rewrote the history of Hungary to emphasize nationalism and deemphasize Austrian influences. By the 1930s, political history was in decline and an effort was made to introduce social history in the style of the French Annales School. After the war only Marxist interpretations were allowed.
With the end of communism in Hungary in 1989, Marxist historiography collapsed and social history came into its own, especially the study of the demographic patterns of the early modern period. Research priorities have shifted toward urban history and the conditions of everyday life.