Louisiana, ruled by the French since the 17th century, was transferred to Spain in 1762 after the French and Indian War, which had pitted Spain and France together against England. Spanish rule would last until 1801, when the province was secretly returned to France. Between 1801 and 1803, President Jefferson negotiated the purchase of Louisiana from the French Government, led by First Consul Napoleon Bonaparte. The Louisiana Purchase marked the beginning of American expansion towards the West, which went on through the 19th century and eventually reached the Pacific. However, it also became a source of conflict with Spain, since the limits of the acquisition had not been specified. It was only after the Adams-Onís Treaty of 1819 that a border was defined between the Viceroyalty of New Spain and the United States.