The European Theatre of World War II opened with the German invasion of Poland on Friday September 1, 1939, followed by the Soviet invasion of Poland on September 17, 1939. On 6 October, following the Polish defeat at the Battle of Kock, German and Soviet forces gained full control over Poland. The success of the invasion marked the end of the Second Polish Republic, though Poland never formally surrendered. A Polish Underground State with a government-in-exile that would eventually set up headquarters in London resumed the struggle against the occupying powers. The Polish forces in the West, as well as in the East and an intelligence service were established outside of Poland, and contributed to the Allied effort throughout the war.