Warsaw is the capital and largest city of Poland. It is located on the Vistula River roughly 360 km (224 mi) from the Baltic Sea and 300 km (186 mi) from the Carpathian Mountains. The first recorded references to the city date from the year 1313. It became the capital of Poland during the period of the Commonwealth of Poland-Lithuania in 1596, replacing Kraków. After the Third Partition of Poland in 1795, Warsaw was incorporated into the Kingdom of Prussia. It was briefly the capital of the Grand Duchy of Warsaw, a French puppet state created by Emperor Napoleon I in 1806. After Napoleon's final defeat in 1815, Warsaw was incorporated into the Russian Empire as part of the so-called "Congress Kingdom of Poland." Germany occupied the city in 1915 during World War I and held it until 1918. As a term of the Treaty of Versailles, the Republic of Poland became an independent state, and Warsaw was designated its capital.
The city suffered greatly during World War II. After Polish capitulation in 1939, the Nazis occupied Warsaw and herded the city's entire Jewish population into the Warsaw Ghetto. The inhabitants rose up in rebellion in 1943 to try to prevent their transport to extermination camps but failed. In August 1944, the underground Polish Home Guard rose to try to retake the city as the Red Army advanced toward the city, but the Home Guard also failed. By war's end in 1945, Warsaw lay in ruins. It was rebuilt as the capital of a reconstituted Polish People's Republic, with wholly new borders, in the sphere of influence of the Soviet Union. In 1989, Poland severed all ties with the Soviets, so Warsaw once again became the capital of a truly independent state.
As Poland's capital, Warsaw was central to the beginnings of World War II. After Poland fell to Germany and the Soviet Union in September, 1939, Warsaw was under Germany's rule, and remained so even after Germany invaded the Soviet Union. In 1945, Warsaw fell to the victorious Soviet Union, which had defeated Germany.
Warsaw was a continued target of Soviet advance and bombardment throughout 1939. However, German and Polish forces were able to keep the Soviets out of the city. Even Joseph Stalin had to admit by the end of 1939 that the drive on Warsaw was going much slower than he wanted. In 1940, the so-called "big switch brought Britain and France into an alliance with Poland and Germany against the USSR, and soon the Red Army was rapidly retreating away from Warsaw and into Soviet territory. While the alliance proved short-lived, and the Soviets were making their way west again by 1943, Warsaw was never threatened again for the duration of the war.