After the defeat of Poland by Germany in the west and the USSR in the east in 1939, Polish soldiers found themselves either trapped in German-occupied Poland or in the USSR. Of the former, many joined the Polish resistance while other escaped to various countries to fight in Allied armed forces or to the Middle East. Those trapped in the USSR were allowed to leave after the German invasion of the Soviet Union along with many women and children, and went to British Mandate Palestine and Egypt. There, various military units were consolidated into the Polish 2nd Corps with 50,000 troops. In 1944-1945, the Corps participated in the Italian Campaign as part of the British 8th Army.