The Polish Underground State (Polish: Polskie Państwo Podziemne, also known as the Polish Secret State) was a single political and military entity formed by the union of resistance organizations in occupied Poland that were loyal to the Government of the Republic of Poland in exile in London. The first elements of the Underground State were established in the final days of the German and Soviet invasion of Poland, in late September 1939. The Underground State was perceived by supporters as a legal continuation of the pre-war Republic of Poland (and its institutions) that waged an armed struggle against the country's occupying powers: Nazi Germany and the Soviet Union. The Underground State encompassed not only military resistance, one of the largest in the world, but also civilian structures, such as justice, education, culture and social services.
Although the Underground State enjoyed broad support throughout much of the war, it was not supported or recognized by the communists and some of the right-wing extremists. The influence of the communists eventually declined amid military reversals (most notably, the failure of the Warsaw Uprising) and the growing hostility of the USSR. The Soviet Union had created an alternative, puppet government in 1944 (the Polish Committee of National Liberation) and ensured it formed the basis of the post-war government in Poland. During the Soviet-backed communist takeover of Poland at the end of the war, many Underground State members were prosecuted as alleged traitors and died in captivity. Abandoned by the Western Allies, finding it impossible to negotiate with the Soviets, and wishing to avoid a civil war, the key institutions of the Underground State dissolved themselves in the first half of 1945.