The Second Hungarian Republic (Hungarian: Magyar Köztársaság) was a parliamentary republic briefly established after the dissolution of the Kingdom of Hungary on 1 February 1946 and dissolved on 20 August 1949. It was succeeded by the People's Republic of Hungary.
From September 1944 until April 1945, as World War II in Europe drew to a close, the Red Army occupied Hungary. The Siege of Budapest lasted almost two months and much of the city was destroyed. Neither the Western Allies nor the Soviet Union supported any changes to Hungary's pre-1938 borders, so the peace treaty signed by Hungary in 1947 declared that "The decisions of the Vienna Award of 2 November 1938 are declared null and void". This meant that Hungary's borders were moved back to those that existed on 1 January 1938 and it lost the territories it had regained between 1938 and 1941. The Soviet Union also annexed Sub-Carpathia, some of which had been part of Hungary before 1938. Between 1946 and 1948, half of Hungary's ethnic German minority (around 250,000 people) were deported to Germany and there was a forced "exchange of population" between Hungary and Czechoslovakia.
The Soviets set up an alternative government in Debrecen on 21 December 1944 before capturing Budapest on 18 January 1945. Zoltán Tildy became the provisional prime minister.
In elections held in November 1945, the Independent Smallholders' Party won 57% of the vote. The Hungarian Communist Party, now under the leadership of Mátyás Rákosi and Ernő Gerő, two survivors from the Hungarian Soviet Republic of 1919, received support from only 17% of the population. The Soviet commander in Hungary, Marshal Kliment Voroshilov, refused to allow the Smallholders Party to form a government. Instead Voroshilov established a coalition government with the communists holding some of the key posts. Under Parliament, the leader of the Smallholders, Zoltán Tildy, was named president and Ferenc Nagy prime minister in February 1946. Mátyás Rákosi became deputy prime minister.
During 1945 and 1946, the national currency, the pengő, was all but destroyed by the most ruinous hyperinflation in recorded history. The only way to restore sanity to the economy was a new currency, so the forint was reintroduced in 1946.
László Rajk became minister of the interior and in this post established the security police (ÁVO). In February 1947 the police began arresting leaders of the Smallholders Party and the National Peasant Party. It also pressured both parties to expel those members who weren't willing to do the Communists' bidding as "fascists." Several prominent figures in both parties escaped abroad. Later, Rákosi boasted that he had dealt with his partners in the government, one by one, "cutting them off like slices of salami."
By 1947, the Communists had all but emasculated the other parties in the coalition, and became the largest single party in elections held that year. The Communists were the dominant partners in the coalition People's Independence Front government. Nagy was replaced as prime minister by the more pliable Lajos Dinnyés.
In October 1947, the Communists dropped all pretense of democracy. Rákosi gave the leaders of the non-Communist parties an ultimatum: cooperate with a new, Communist-dominated coalition government or go into exile. The Social Democratic Party effectively ceased to exist as an independent organization, and Independent Smallholders' Party secretary Béla Kovács was arrested and sent to Siberia. Other opposition leaders such as Anna Kéthly, Ferenc Nagy and István Szabó were imprisoned or sent into exile.
The Republic of Hungary effectively ended in June 1948, when the Social Democrats were forced to merge with the Communists to form the Hungarian Working People's Party. The few independent-minded Social Democrats still left in the party were soon pushed out, leaving the MDP as the MKP under a new name. In August, Tildy was forced out as president in favour of Social Democrat-turned-Communist Árpád Szakasits. That December, Dinnyés was replaced as leader of the Smallholders and prime minister by the openly pro-Communist István Dobi. At the 1949 elections, voters were presented with a single list from the Communist-controlled Independent People's Front, which carried 95 percent of the vote.
On 18 August 1949, the Parliament passed Hungary's first written constitution (1949/XX.)--a near-carbon copy of the 1936 constitution of the Soviet Union. The name of the country became 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 as the main goal of the nation. A new coat of arms was adopted with Communist symbols, such as the red star, a hammer, and an ear of wheat.