linguistic:paraphrasing, structural:expansion
Free City of Danzig and World War II

When Poland regained its independence after World War I with access to the sea as promised by the Allies on the basis of Woodrow Wilson 's " Fourteen Points " (point 13 called for "an independent Polish state", "which should be assured a free and secure access to the sea"), the Poles hoped the city's harbour would also become part of Poland. However, in the end – since Germans formed a majority in the city, with Poles being a minority (in the 1923 census 7,896 people out of 335,921 gave Polish, Kashubian, or Masurian as their native language) – the city was not placed under Polish sovereignty. Instead, in accordance with the terms of the Versailles Treaty, it became the Free City of Danzig, an independent quasi-state under the auspices of the League of Nations with its external affairs largely under Polish control. Poland's rights also included free use of the harbour, a Polish post office, a Polish garrison in Westerplatte district, and customs union with Poland. The Free City had its own constitution, national anthem, parliament, and government (Senat). It issued its own stamps as well as its currency, the Danzig gulden.

With the growth of Nazism among Germans, anti-Polish sentiment increased and both Germanisation and segregation policies intensified, in the 1930s the rights of local Poles were commonly violated and limited by the local administration. Polish children were refused admission to public Polish-language schools, premises were not allowed to be rented to Polish schools and preschools. Due to such policies, only eight Polish-language public schools existed in the city, and Poles managed to organize seven more private Polish schools.

In the early 1930s, the local Nazi Party capitalised on pro-German sentiments and in 1933 garnered 50% of vote in the parliament. Thereafter, the Nazis under Gauleiter Albert Forster achieved dominance in the city government, which was still nominally overseen by the League of Nations' High Commissioner.

In 1937, Poles who sent their children to private Polish schools were required to transfer children to German schools, under threat of police intervention, and attacks were carried out on Polish schools and Polish youth. German militias carried out numerous beatings of Polish activists, scouts and even postal workers, as "punishment" for distributing the Polish press. German students attacked and expelled Polish students from the technical university. Dozens of Polish surnames were forcibly Germanized, while Polish symbols that reminded that for centuries Gdańsk was part of Poland were removed from the city's landmarks, such as the Artus Court and the Neptune's Fountain.

From 1937, the employment of Poles by German companies was prohibited, and already employed Poles were fired, the use of Polish in public places was banned and Poles were not allowed to enter several restaurants, in particular those owned by Germans. In 1939, before the German invasion of Poland and outbreak of World War II, local Polish railwaymen were victims of beatings, and after the invasion, they were also imprisoned and murdered in concentration camps.

The German government officially demanded the return of Danzig to Germany along with an extraterritorial (meaning under German jurisdiction) highway through the area of the Polish Corridor for land-based access from the rest of Germany. Hitler used the issue of the status of the city as a pretext for attacking Poland and in May 1939, during a high-level meeting of German military officials explained to them: "It is not Danzig that is at stake. For us it is a matter of expanding our Lebensraum in the east", adding that there will be no repeat of the Czech situation, and Germany will attack Poland at first opportunity, after isolating the country from its Western Allies.

After the German proposals to solve the three main issues peacefully were refused, German-Polish relations rapidly deteriorated. Germany attacked Poland on 1 September after having signed a non-aggression pact with the Soviet Union.

The German attack began in Danzig, with a bombardment of Polish positions at Westerplatte by the German battleship Schleswig-Holstein, and the landing of German infantry on the peninsula. Outnumbered Polish defenders at Westerplatte resisted for seven days before running out of ammunition. Meanwhile, after a fierce day-long fight (1 September 1939), defenders of the Polish Post office were tried and executed then buried on the spot in the Danzig quarter of Zaspa in October 1939. In 1998 a German court overturned their conviction and sentence. The city was officially annexed by Nazi Germany and incorporated into the Reichsgau Danzig-West Prussia.

About 50 percent of members of the Jewish community had left the city within a year after a pogrom in October 1937. After the Kristallnacht riots in November 1938, the community decided to organize its emigration and in March 1939 a first transport to Palestine started. By September 1939 barely 1,700 mostly elderly Jews remained. In early 1941, just 600 Jews were still living in Danzig, most of whom were later murdered in the Holocaust. Out of the 2,938 Jewish community in the city, 1,227 were able to escape from the Nazis before the outbreak of war.

Nazi secret police had been observing Polish minority communities in the city since 1936, compiling information, which in 1939 served to prepare lists of Poles to be captured in Operation Tannenberg. On the first day of the war, approximately 1,500 ethnic Poles were arrested, some because of their participation in social and economic life, others because they were activists and members of various Polish organisations. On 2 September 1939, 150 of them were deported to the Sicherheitsdienst camp Stutthof some 50 km (30 mi) from Danzig, and murdered. Many Poles living in Danzig were deported to Stutthof or executed in the Piaśnica forest.

During the war, Germany operated a prison in the city, an Einsatzgruppen -operated penal camp, a camp for Romani people, two subcamps of the Stalag XX-B prisoner-of-war camp for Allied POWs, and several subcamps of the Stutthof concentration camp within the present-day city limits.

In 1941, Hitler ordered the invasion of the Soviet Union, eventually causing the fortunes of war to turn against Germany. As the Soviet Army advanced in 1944, German populations in Central and Eastern Europe took flight, resulting in the beginning of a great population shift. After the final Soviet offensives began in January 1945, hundreds of thousands of German refugees converged on Danzig, many of whom had fled on foot from East Prussia, some tried to escape through the city's port in a large-scale evacuation involving hundreds of German cargo and passenger ships. Some of the ships were sunk by the Soviets, including the Wilhelm Gustloff after an evacuation was attempted at neighbouring Gdynia. In the process, tens of thousands of refugees were killed.

The city also endured heavy Allied and Soviet air raids. Those who survived and could not escape had to face the Soviet Army, which captured the heavily damaged city on 30 March 1945, followed by large-scale rape and looting.

In line with the decisions made by the Allies at the Yalta and Potsdam conferences, the city became again part of Poland, although with a Soviet-installed communist regime, which stayed in power until the Fall of Communism in the 1980s. The remaining German residents of the city who had survived the war fled or were expelled to postwar Germany. The city was repopulated by ethnic Poles; up to 18 percent (1948) of them had been deported by the Soviets in two major waves from pre-war eastern Polish areas annexed by the Soviet Union.