He was born into a peasant family in Kaposvar, Hungary, which at the time was part of the Austro-Hungarian Empire. He left school at a young age and became an apprentice, and served in World War I until he was captured by the Czarist army. He became a communist after the Communist Revolution in Russia, and worked for the communist underground between the wars in the Soviet Union.
During the Soviet occupation of Hungary after World War II, Nagy returned to Budapest to serve in the government. When he protested communist agricultural policies he was expelled from the Politburo, but allowed to return to the party in 1951 to carry out policies he had protested. He became premier after Stalin's death when the Soviet Premier Malenkov, who had replaced Stalin, favored him.
Nagy supported allowing allowing peasants to leave collective farms. Nagy opposed the police terror. When Malenkov lost power in the Soviet Union, Nagy lost power in Hungary.
In October 23, 1956, the shooting of student demonstrations in Budapest cause massive unrest and an uprising against the communists. An emergency meeting of the party Central Committee elected Nagy prime minister, but he only held that spot for slightly more than 10 days.
Nagy offered amnesty to the demonstrators and thought he had negotiated the withdrawal of Soviet troops from Hungary. He ended the one-party system and supported free elections. The Soviets deceived him. Nagy withdrew Hungary from the Warsaw Pact, but the Soviets brutally invaded Budapest on November 4, 1956. Nagy fled to the Yugoslav Embassy, which had promised him safe passage.
Told he could safely leave the country, Nagy boarded a Yugoslav bus. The Soviets seized it, and flew him to Romania. Nagy refused to endorse the new puppet government of Hungary established by the Soviets.
Nagy was held captive for about two years, tried in secret, and executed on June 16, 1958.