The War of 1812 was a military conflict fought between the forces of the United States of America and those of the British Empire.[nb 2] The Americans declared war in 1812 for a number of reasons, including a desire for expansion into the Northwest Territory, trade restrictions because of Britain's ongoing war with France, impressment of American merchant sailors into the Royal Navy, British support of American Indian tribes against American expansion, and the humiliation of American honour. Until 1814, the British Empire adopted a defensive strategy, repelling multiple American invasions of the provinces of Upper and Lower Canada. However, the Americans gained control over Lake Erie in 1813, seized parts of western Ontario, and destroyed Tecumseh's dream of an Indian confederacy. In the Southwest General Andrew Jackson humbled the Creek nation at the Battle of Horseshoe Bend but with the defeat of Napoleon in 1814, the British adopted a more aggressive strategy, sending in three large armies along with more patrols. British victory at the Battle of Bladensburg in August 1814 allowed the British to capture and burn Washington, D.C. American victories in September 1814 and January 1815 repulsed British invasions of New York and New Orleans.
The war was fought in three theaters: At sea, warships and privateers of both sides attacked each other's merchant ships. The British blockaded the Atlantic coast of the U.S. and mounted large-scale raids in the later stages of the war. Both land and naval battles were fought on the frontier, which ran along the Great Lakes and Saint Lawrence River. The South and the Gulf coast saw major land battles in which the American forces destroyed Britain's Indian allies and defeated the main British invasion force at New Orleans. Both sides invaded each other's territory, but these invasions were unsuccessful or temporary. At the end of the war, both sides occupied parts of the other's territory, but these areas were restored by the Treaty of Ghent.
In the U.S., battles such as the Battle of New Orleans and the earlier successful defense of Baltimore (which inspired the lyrics of the U.S. national anthem, "The Star-Spangled Banner") produced a sense of euphoria over a "second war of independence" against Britain. It ushered in an "Era of Good Feelings" in which the partisan animosity that had once verged on treason practically vanished. Canada also emerged from the war with a heightened sense of national feeling and solidarity. Britain regarded the war as a sideshow to the Napoleonic Wars raging in Europe; it welcomed an era of peaceful relations and trade with the United States.