<P> In 1798, Spain revoked the treaty allowing American use of New Orleans, greatly upsetting Americans . In 1801, Spanish Governor Don Juan Manuel de Salcedo took over from the Marquess of Casa Calvo, and restored the American right to deposit goods . However, in 1800 Spain had ceded the Louisiana territory back to France as part of Napoleon's secret Third Treaty of San Ildefonso . The territory nominally remained under Spanish control, until a transfer of power to France on 30 November 1803, just three weeks before the formal cession of the territory to the United States on 20 December 1803 . A further ceremony was held in St. Louis a few months later partially due to winter conditions impeding the arrival of news, Upper Louisiana, regarding the New Orleans formalities . The 9 - 10 March 1804 event is remembered as Three Flags Day . </P> <P> James Monroe and Robert R. Livingston had traveled to Paris to negotiate the purchase of New Orleans in January 1803 . Their instructions were to negotiate or purchase control of New Orleans and its environs; they did not anticipate the much larger acquisition which would follow . </P> <P> The Louisiana Purchase was by far the largest territorial gain in U.S. history . Stretching from the Mississippi River to the Rocky Mountains, the purchase doubled the size of the United States . Before 1803, Louisiana had been under Spanish control for forty years . Although Spain aided the rebels in the American Revolutionary War, the Spanish didn't want the Americans to settle in their territory . </P> <P> Although the purchase was thought of by some as unjust and unconstitutional, Jefferson determined that his constitutional power to negotiate treaties allowed the purchase of what became fifteen states . In hindsight, the Louisiana Purchase could be considered one of his greatest contributions to the United States . On April 18, 1802, Jefferson penned a letter to United States Ambassador to France Robert Livingston . It was an intentional exhortation to make this supposedly mild diplomat strongly warn the French of their perilous course . The letter began: </P>

What did the louisiana purchase do for the us
find me the text answering this question