On August 29, 1944, Soviet troops reached the border of East Prussia. By January 1945, they had taken all of East Prussia except for the area around Königsberg. Many inhabitants fled west at this time. During the last days of the war, over two million people fled before the Red Army and were evacuated by sea. Under the terms of the Potsdam Agreement, the city became part of the Soviet Union pending the final determination of territorial questions at a peace settlement. This final determination took place on September 12, 1990 with the signing of the Treaty on the Final Settlement with Respect to Germany. The excerpt pertaining to the partition of East Prussia including the area surrounding Königsberg is as follows (note that Königsberg is spelt "Koenigsberg" in the original document):