As the war ended and Poland regained independence, he was admitted to the Polish Army as a lieutenant. In 1918 he built armoured trains in Nowy Sącz and Przemyśl and traveled to the besieged Lviv. He was promoted to the rank of captain in the corps of railway officers on 1 June 1919.