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 war's last days, over two million people fled before the Red Army and were evacuated by sea. Under the Potsdam Agreement's terms, 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 12 September 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):