Göncz graduated in law from the Budapest Pázmány Péter University of Arts and Sciences in 1944. During his academic years, he was exempted from conscription in the Second World War. Meanwhile, Hungary was occupied by Germany on 19 March 1944. In December, Göncz was conscripted into the 25th Reserve Mountain Infantry Battalion of the Royal Hungarian Army and ordered to Germany; however, he deserted and joined the resistance movement. In late 1944, Göncz found himself in Budapest when the Red Army encircled the Hungarian capital, beginning the Siege of Budapest. The resistant Hungarian Front formed to opposite the Nazi regime with several regional branches, including the Freedom Front of Hungarian Students (MDSZ) which established officially on 7 November 1944, during the Arrow Cross Party government. Göncz joined the Táncsics Battalion in December 1944, where he took part in partisan actions against the Arrow Cross regime in Budapest. After the war he went on to study agricultural science.