Graduate of the General Staff Academy in Vienna, from 1914 he was a commander of the 100th Infantry Regiment of Austria-Hungary, with whom he participated in May 1915 in the break-up of the Russian front in the Battle of Gorlice. From 1918 after Poland gained independence, he served in the Polish Army; in January 1919 he was the commander of Polish forces fighting in Cieszyn Silesia against the Czech offensive. During the Battle of Warsaw in 1920 he commanded the First Polish Army and served as the military governor of the city besieged by the Red Army.