Born on 19 August 1896 in Nowy Sącz, Austrian Galicia, Berek studied medicine at the Jagiellonian University in Kraków. In May 1918 he joined Polish Military Organisation, and in November of the same year he fought in the Battle of Lemberg, as leader of a company in 5th Legions' Infantry Regiment. In February 1919, Berek became company leader in the 9th Legions Infantry Regiment, stationed at Lublin. He remained in his post until April 1926, fighting in the Polish–Soviet War. On 1 June 1919 Berek was promoted to major.