The Treaty of San Ildefonso was signed in 1800, between France and Spain, secretly agreeing to transfer Louisiana from Spain back to France. This paved the way for the eventual sale of the Louisiana Territory to the United States in the Louisiana Purchase of 1803.