In 1763, the French colony was ceded to the Spanish Empire and remained under Spanish control for 40 years. Most of the surviving architecture of the French Quarter dates from this Spanish period. Louisiana reverted to French control in 1801, but two years later Napoleon sold it to the United States in the Louisiana Purchase. The city grew rapidly, with influxes of Americans, French and Creole French.
During the War of 1812 the British sent a force to conquer the city. The British were defeated by American forces led by Andrew Jackson in the Battle of New Orleans on January 8, 1815. However, a peace treaty was signed between the United States and Britain on December 24, 1814, and news of the treaty did not reach the United States in time to prevent the battle from occurring.
By 1840, New Orleans had become by far the wealthiest city in the nation, and was also ranked as the third most populous, being beaten by Baltimore by only 119 people. Since that time, the city has become the thirteenth poorest large city in the Nation. Up until 1960 New Orleans had consistently been ranked in the top fifteen largest Cities in the U.S. but since that time, the city has shrunk to the thirty-fifth largest city in the U.S.
The population of the city doubled in the 1830s, and by 1840 the city's population was over 100,000—one of the largest cities in the U.S. Population growth was frequently interrupted by yellow fever epidemics, the last of which occurred in 1905.