After the 1939 Soviet occupation of Eastern Poland, he was not allowed to study at Lwow Polytechnic as he wished because of his "bourgeois origin", and only due to his father's connections he was accepted to study medicine at Lwów University in 1940. During the subsequent Nazi occupation (1941–1944), Lem's Jewish family avoided placement in the Nazi Lwów Ghetto, surviving with false papers. He would later recall: