During World War II, Beynar was a soldier in the Polish Army, fighting the German "Wehrmacht" when it invaded Poland in September 1939. He commanded a platoon near Sandomierz and was eventually taken prisoner by the Germans. While in a temporary prisoner-of-war camp in Opatów, he was able to escape with the help of some old school friends from the time his family lived there in the early 1920s. He joined the Polish underground organization, "Związek Walki Zbrojnej" (Association for Armed Combat), later transformed into the "Armia Krajowa" ("AK"; the Home Army), and continued the fight against the Germans. In the resistance he had the rank of lieutenant, worked in the local Wilno headquarters and was an editor of an underground newspaper "Pobudka". He was also involved in the underground teaching. In July 1944 he took part in the operation aimed at the liberation of Wilno from the Germans (Operation Ostra Brama). In the wake of this operation, around 19–21 August, his partisan unit, like many others, was intercepted and attacked by the Soviets. He was taken prisoner; sources vary as to whether he was to be exiled to Siberia or conscripted into the Polish People's Army. Either way he escaped and rejoined AK partisans (the Home Army 5th Wilno Brigade). For a while, he was an aide to Major Zygmunt Szendzielarz ("Łupaszko") and was member of the anti-Soviet resistance, "Wolność i Niezawisłość" ("WiN", Freedom and Independence). He was promoted to the rank of captain. Wounded in August 1945, he left the Brigade before it was destroyed by the Soviets, and avoided the fate of most of its officers who were sentenced to death. While recovering from his wounds, he found shelter in the village of Jasienica.