The Second World War in 1939 ended the sovereign Second Polish Republic. The German invasion of Poland began on 1 September 1939, one week after Nazi Germany and the Soviet Union signed the secret Molotov–Ribbentrop Pact. On that day, Germany and Slovakia attacked Poland, and on 17 September the Soviets attacked eastern Poland. Warsaw fell to the Nazis on 28 September after a twenty-day siege. Open organized Polish resistance ended on 6 October 1939 after the Battle of Kock, with Germany and the Soviet Union occupying most of the country. Lithuania annexed the area of Wilno, and Slovakia seized areas along Poland's southern border - including Górna Orawa and Tatranská Javorina - which Poland had annexed from Czechoslovakia in October 1938. Poland did not surrender to the invaders, but continued fighting under the auspices of the Polish government-in-exile and of the Polish Underground State. After the signing of the German–Soviet Treaty of Friendship, Cooperation and Demarcation on 28 September 1939, Polish areas occupied by Nazi Germany either became directly annexed to the Third Reich, or became part of the General Government. The Soviet Union, following Elections to the People's Assemblies of Western Ukraine and Western Belarus (22 October 1939), annexed eastern Poland partly to the Byelorussian Soviet Socialist Republic, and partly to the Ukrainian Soviet Socialist Republic (November 1939).