Imre Varga was born on August 27, 1909 in the village of Fehértemplom, in what is now Vojvodina, Serbia, his father was a forensic officer. In 1935, he obtained a doctorate in law and political science, after which he worked as a trainee lawyer, but also took on all kinds of odd jobs. After serving as a conscript in the Air Defence Forces in 1931, he was called up again in 1939 and subsequently became a professional officer as a probationary probationary officer. In the summer of 1944 he was posted to the 201st Anti-Aircraft Flare Division in Budapest. Between 2 December 1944 and 3 January 1945, he served in front-line service as commander of an alert squadron, after which he withdrew from combat. On 11 February 1945, he and his platoon were transferred to Soviet troops. He was a prisoner of war until 19 March 1945, after which the Soviets handed him over to the new Hungarian army. There, after various short service posts, he became a candidate military judge and then a military prosecutor.
In his autobiography, dated late 1949, he did his best to present himself as an officer loyal to the regime and wrote enthusiastically that he could see his future not only as a judge advocate but also as an air defence troop. "I carefully select my circle of friends; I do not even associate with opportunists, Westerners or enemies of the class, even if it is only by greeting." He joined the MKP in 1947. A year later, he joined the Freedom Fighters' League, but was expelled from the MDP in 1949 in connection with the revision of its membership, despite the fact that he had undertaken various party activities.
All this did not impress the HM staff. In hindsight, it was more a compliment that he was rated as the worst army judge advocate ("ideologically, too, although he was training himself, he showed no improvement") and was therefore demobbed in 1950. He then became legal adviser to the Leather Industry Company.