During World War II Hungary was a member of the Axis powers, allied with the forces of Nazi Germany, Fascist Italy, Romania, and Bulgaria. In 1941, the Hungarian military participated in the occupation of Yugoslavia and the invasion of the Soviet Union. The Red Army was able to force back the Hungarian and other Axis invaders, and by 1944 was advancing towards Hungary.
Fearing invasion, the Hungarian government began armistice negotiations with the Allies. These ended when Nazi Germany invaded and occupied the country and set up the pro-Axis Government of National Unity.
Both Hungarian and German forces stationed in Hungary were subsequently defeated when the Soviet Union invaded the country in late 1944.
Towards the end of World War II, the Soviet Army occupied Hungary, with the country coming under the Soviet Union's sphere of influence. Immediately after World War II, Hungary was a multiparty democracy, and elections in 1945 produced a coalition government under Prime Minister Zoltán Tildy. However, the Hungarian Communist Party, a Marxist–Leninist group who shared the Soviet government's ideological beliefs, constantly wrested small concessions in a process named salami tactics, which sliced away the elected government's influence, despite the fact that it had received only 17% of the vote.
After the elections of 1945, the portfolio of the Interior Ministry, which oversaw the Hungarian State Security Police (Államvédelmi Hatóság, later known as the ÁVH), was transferred from the Independent Smallholders Party to a nominee of the Communist Party. The ÁVH employed methods of intimidation, falsified accusations, imprisonment, and torture to suppress political opposition. The brief period of multi-party democracy came to an end when the Communist Party merged with the Social Democratic Party to become the Hungarian Working People's Party, which stood its candidate list unopposed in 1949. The People's Republic of Hungary was then declared.
The Hungarian Working People's Party set about to modify the economy into socialism by undertaking radical nationalization based on the Soviet model. Writers and journalists were the first to voice open criticism of the government and its policies, publishing critical articles in 1955. By 22 October 1956, Technical University students had resurrected the banned MEFESZ student union, and staged a demonstration on 23 October that set off a chain of events leading directly to the revolution.
Political repression and economic decline
Hungary became a communist state under the authoritarian leadership of Mátyás Rákosi. Under Rákosi's reign, the Security Police (ÁVH) began a series of purges, first within the Communist Party to end opposition to Rákosi's reign. The victims were labeled as "Titoists," "western agents," or "Trotskyists" for as insignificant a crime as spending time in the West to participate in the Spanish Civil War. In total, about half of all the middle and lower level party officials—at least 7,000 people—were purged.
Mátyás Rákosi speaks in Budapest, 1948
From 1950 to 1952, the Security Police forcibly relocated thousands of people to obtain property and housing for the Working People's Party members, and to remove the threat of the intellectual and 'bourgeois' class. Thousands were arrested, tortured, tried, and imprisoned in concentration camps, deported to the east, or were executed, including ÁVH founder László Rajk. In a single year, more than 26,000 people were forcibly relocated from Budapest. As a consequence, jobs and housing were very difficult to obtain. The deportees generally experienced terrible living conditions and were interned as slave labor on collective farms. Many died as a result of poor living conditions and malnutrition.
The Rákosi government thoroughly politicised Hungary's educational system to supplant the educated classes with a "toiling intelligentsia". Russian language study and Communist political instruction were made mandatory in schools and universities nationwide. Religious schools were nationalized and church leaders were replaced by those loyal to the government. In 1949 the leader of the Hungarian Catholic Church, Cardinal József Mindszenty, was arrested and sentenced to life imprisonment for treason. Under Rákosi, Hungary's government was among the most repressive in Europe.
The post-war Hungarian economy suffered from multiple challenges. Hungary agreed to pay war reparations approximating US$300 million to the Soviet Union, Czechoslovakia, and Yugoslavia and to support Soviet garrisons. The Hungarian National Bank in 1946 estimated the cost of reparations as "between 19 and 22 per cent of the annual national income." In 1946, the Hungarian currency experienced marked depreciation, resulting in the highest historic rates of hyperinflation known. Hungary's participation in the Soviet-sponsored COMECON (Council Of Mutual Economic Assistance) prevented it from trading with the West or receiving Marshall Plan aid.
In addition, Rákosi began his first Five-Year Plan in 1950-based on Joseph Stalin's industrial program of the same name that sought to raise industrial output by 380 percent. Like its Soviet counterpart, the Five-Year Plan never achieved these outlandish goals due in part to the crippling effect of the exportation of most of Hungary's raw resources and technology to the Soviet Union as well as Rákosi's purges of much of the former professional class. In fact, the Five-Year Plan weakened Hungary's existing industrial structure and caused real industrial wages to fall by 18 percent between 1949 and 1952.
Although national income per capita rose in the first third of the 1950s, the standard of living fell. Huge income deductions to finance industrial investment reduced disposable personal income; mismanagement created chronic shortages in basic foodstuffs resulting in rationing of bread, sugar, flour, and meat. Compulsory subscriptions to state bonds further reduced personal income. The net result was that disposable real income of workers and employees in 1952 was only two-thirds of what it had been in 1938, whereas in 1949, the proportion had been 90%. These policies had a cumulative negative effect and fueled discontent as foreign debt grew and the population experienced shortages of goods.
Imre Nagy (center) in October 1956
On 5 March 1953, Joseph Stalin died, ushering in a period of moderate liberalization, when most European communist parties developed a reform wing. In Hungary, the reformist Imre Nagy replaced Rákosi, "Stalin's Best Hungarian Disciple", as Prime Minister. However, Rákosi remained General Secretary of the Party, and was able to undermine most of Nagy's reforms. By April 1955, he had Nagy discredited and removed from office. After Khrushchev's "secret speech" of February 1956, which denounced Stalin and his protégés, Rákosi was deposed as General Secretary of the Party and replaced by Ernő Gerő on 18 July 1956. Radio Free Europe (RFE) broadcast the "secret speech" to Eastern Europe on the advice of Ray S. Cline, who saw it as a way to "as I think I told [Allen Dulles] to say, 'indict the whole Soviet system'." 
On 14 May 1955, the Soviet Union created the Warsaw Pact, binding Hungary to the Soviet Union and its satellite states in Central and Eastern Europe. Among the principles of this alliance were "respect for the independence and sovereignty of states" and "non-interference in their internal affairs".
In 1955, the Austrian State Treaty and ensuing declaration of neutrality established Austria as a demilitarised and neutral country. This raised Hungarian hopes of also becoming neutral and in 1955 Nagy had considered "... the possibility of Hungary adopting a neutral status on the Austrian pattern".
In June 1956, a violent uprising by Polish workers in Poznań was put down by the government, with scores of protesters killed and wounded. Responding to popular demand, in October 1956, the government appointed the recently rehabilitated reformist communist Władysław Gomułka as First Secretary of the Polish United Workers' Party, with a mandate to negotiate trade concessions and troop reductions with the Soviet government. After a few tense days of negotiations, on 19 October the Soviets finally gave in to Gomułka's reformist demands. News of the concessions won by the Poles, known as Polish October, emboldened many Hungarians to hope for similar concessions for Hungary and these sentiments contributed significantly to the highly charged political climate that prevailed in Hungary in the second half of October 1956.
Within the Cold War context of the time, by 1956, a fundamental tension had appeared in US policy towards Hungary and the Eastern Bloc generally. The United States hoped to encourage European countries to break away from the bloc through their own efforts but wanted to avoid a US-Soviet military confrontation, as escalation might lead to nuclear war. For these reasons, US policy makers had to consider other means of diminishing Soviet influence in Eastern Europe, short of a rollback policy. This led to the development of containment policies such as economic and psychological warfare, covert operations, and, later, negotiation with the Soviet Union regarding the status of the Eastern states. Vice President Richard Nixon had also argued to the National Security Council that it would serve US interests if the Soviet Union would turn on another uprising as they had in Poland, providing a source of anti-Communist propaganda. However, while Central Intelligence Agency (CIA) director Allen Dulles had claimed he was creating an extensive network in Hungary, at the time the agency had no Hungarian station, almost no agents who spoke the language, and unreliable, corrupt local assets. The agency's own secret history admitted "at no time did we have anything that could or should have been mistaken for an intelligence operation".
In the summer of 1956, relations between Hungary and the US began to improve. At that time, the US responded very favourably to Hungary's overtures about a possible expansion of bilateral trade relations. Hungary's desire for better relations was partly attributable to the country's catastrophic economic situation. Before any results could be achieved, however, the pace of negotiations was slowed by the Hungarian Ministry of Internal Affairs, which feared that better relations with the West might weaken Communist rule in Hungary.
Social unrest builds
Rákosi's resignation in July 1956 emboldened students, writers, and journalists to be more active and critical in politics. Students and journalists started a series of intellectual forums examining the problems facing Hungary. These forums, called Petőfi circles, became very popular and attracted thousands of participants. On 6 October 1956, László Rajk, who had been executed by the Rákosi government, was reburied in a moving ceremony that strengthened the party opposition.
On 16 October 1956, university students in Szeged snubbed the official communist student union, the DISZ, by re-establishing the MEFESZ (Union of Hungarian University and Academy Students), a democratic student organization, previously banned under the Rákosi dictatorship. Within days, the student bodies of Pécs, Miskolc, and Sopron followed suit. On 22 October, students of the Technical University compiled a list of sixteen points containing several national policy demands. After the students heard that the Hungarian Writers' Union planned on the following day to express solidarity with pro-reform movements in Poland by laying a wreath at the statue of Polish-born hero General Józef Zachariasz Bem, who was also a hero of the Hungarian Revolution of 1848 (1848–49), the students decided to organize a parallel demonstration of sympathy and unity.