Before World War II, some of the territories to the east of the line had belonged to Germany. The decision to move Poland's western boundary westwards was made at the Yalta Conference shortly before the end of World War II. The precise location of the border was left open; the western Allies preferred a line slightly east of the current Oder-Neisse line.
The intention of the Allied powers was to punish Germany for its aggression in World War II, and to compensate Poland for lands taken by the Soviet Union at the beginning of the war. It has been suggested that the real reason was Franklin Delano Roosevelt's strong desire to appease Stalin any way he could, to gain his support for the war in the Pacific.
After the German surrender, Soviet armies were in control of Eastern Europe. Faced with this fait accompli, it was decided at the Potsdam Conference to put the German territories east of the Oder-Neisse line (by communist propaganda in Poland referred to as "Western Territories" or "Regained Territories") under Polish administrative control until a final peace treaty would determine the exact border; it was also agreed that Germans remaining in Poland proper should be transferred to Germany. The affected areas included western and southern East-Prussia, most of Pomerania and nearly all of Silesia; the northern part of East Prussia was added to the Soviet Union.
Poland sent troops under Moscow's orders, in order to expel the Ukrainians in the east and the Germans in the west. It took years and some towns were subjected to forced expulsion several times. This might be seen as evidence that many of the local inhabitants were willing to protect their neighbors from expulsion. The expelled Germans were replaced with ethnic Poles, and also with Ukrainians, Belorusan and Lithuanians, displaced by the Soviet annexation of formerly Polish lands. The city of Wrocław (German: Breslau) received a large group of Ukrainians from L'viv. Poland also expelled ethnic Germans from Poland proper and the Polish Corridor. As a result, many German inhabitants of those territories ended up as refugees all over East and West Germany and throughout many other countries.
Communist occupied East Germany signed a treaty with Poland in 1950 recognizing the Oder-Neisse line as a permanent border. In 1952, recognition of the Oder-Neisse line as a permanent boundary was one of the conditions for the Soviet Union to agree to a reunified Germany. The reunification was rejected by West German chancellor Konrad Adenauer for several reasons.
In occupied West Germany, recognition of the line as permanent was initially unacceptable. In fact, West Germany as part of the Hallstein Doctrine did not recognize either Poland or East Germany. The West German attitude changed with the policy of Ostpolitik led by Willy Brandt; in 1970 West Germany signed treaties with Poland and the Soviet Union recognizing the Oder-Neisse line as a factual border of Poland, thus making family visits by the displaced eastern Germans to their former homelands possible. In 1991 as a prerequisite for the unification with East Germany, the Federal Republic of Germany amended its constitution, the Basic Law, to remove the article concerning unification of pre-war German areas, as a further sign of recognition of the line.
Many expellees (German: Heimatvertriebene) from the land east of the Oder-Neisse received refuge in West-Germany. Some of the expellees are active in politics and belong to the political right-wing, some others do not belong to any organizations, but continue to maintain what they call a lawful right to their homeland. The vast majority pledged to work peacefully towards that goal, while rebuilding post-war West Germany.
In a document signed 50 years ago the Heimatvertriebene organisations have also recognized the plight of the different groups of people living in today's Poland who were by force resettled there. The Heimatvertriebene are a fringe group in today's Germany, and there is currently little support for reopening the border issue.
The 1991 Polish-German border agreement finalized the Oder-Neisse line as the Polish-German border and was also supposed to grant the German minority in Poland several rights such as the right to use German surnames, their native language, schools, and churches.
Relations between Poland and Germany are good, and there are no fears within Poland that Germany would annex the land east of the Oder-Neisse line. There are however worries that descendants of the expelled Germans would attempt to buy back their land. This has led to Polish restrictions on the sale of property to foreigners (a special permission is needed and is nearly impossible to get).