The first anti-Jewish measures were enacted in Germany with the onset of Nazism, without the actual ghettoization planning for the German Jews which was rejected in the post-Kristallnacht period. However, soon after the 1939 German invasion of Poland, the Nazis began to designate areas of larger Polish cities and towns as exclusively Jewish, and within weeks, embarked on a massive programme of uprooting Polish Jews from their homes and businesses through forcible expulsions. The entire Jewish communities were deported into these closed off zones by train from their places of origin systematically, using Orpo battalions, first in the Reichsgaue, and then throughout the Generalgouvernement territory.
The first ghetto of World War II was established on 8 October 1939 at Piotrków Trybunalski (38 days after the invasion), with the Tuliszków ghetto established in December 1939. The first large metropolitan ghetto known as the Łódź Ghetto (Litzmannstadt) followed them in April 1940, and the Warsaw Ghetto in October. Most Jewish ghettos were established in 1940 and 1941. Subsequently, many ghettos were sealed from the outside, walled off with brickwork, or enclosed with barbed wire. In the case of sealed ghettos, any Jew found leaving there could be shot. The Warsaw Ghetto, located in the heart of the city, was the largest ghetto in Nazi occupied Europe, with over 400,000 Jews crammed into an area of 1.3 square miles (3.4 km2). The Łódź Ghetto was the second largest, holding about 160,000 people. According to the United States Holocaust Memorial Museum archives, there were at least 1,000 such ghettos in German-occupied and annexed Poland and the Soviet Union alone.