In the last part of the eighteenth century the Louisiana Territory was owned by Spain. This meant that the Spanish government controlled access to the Gulf of Mexico from the Mississippi. Farmers on the Western frontier needed the Mississippi River to get their goods to markets on the East Coast. The problem here being that American goods had to go through Louisiana to get to the East Coast by ship. With Pinckney's treaty of 1795 Spain granted American farmers the right to ship their goods on the Mississippi without paying tolls to do so. It also allowed American merchants permission to transship goods from New Orleans to Atlantic ports without paying export taxes. .
This all changed with the secret treaty of San Ildefonso in 1800 between France and Spain. The treaty gave Louisiana to France and Napoleon Bonaparte. This was of great concern to the American government because America had agreement with France for the use of the Mississippi. Another concern for the American government was that if Napoleon decided to extend his empire to the New World they would have to defend themselves against his armies. President Jefferson attacked this problem on two fronts: .
1) He sent James Monroe to England to seek a military alliance to help with the protecting of American interests.
2) He instructed James Monroe to tell Robert Livingston (the American Minister to France) to offer France 2 million dollars for New Orleans or least get a guarantee of free passage on the river for American ships.
Napoleon dreams of conquering the New World may have died with the failed attempt to restore French control of Hispaniola. The large army he sent in 1802 was virtually destroyed by yellow fever. Deciding to focus his efforts on Europe Napoleon told Livingston and Monroe that they could have the Louisiana Territory for 15 million dollars. President Jefferson happily approved the deal because not only did it keep France out of America and he didn't have to have to go through with the military alliance.