The War of 1812 was a conflict fought between the United States, the United Kingdom, and their respective allies from June 1812 to February 1815. Historians in Britain often see it as a minor theater of the Napoleonic Wars; in the United States and Canada, it is seen as a war in its own right.
From the outbreak of war with Napoleonic France, Britain had enforced a naval blockade to choke off neutral trade to France, which the US contested as illegal under international law. To man the blockade, Britain impressed American merchant sailors into the Royal Navy. Incidents such as the Chesapeake–Leopard affair, which happened five years before the war, inflamed anti-British sentiment in the US. In 1811, the British were in turn outraged by the Little Belt affair, in which 11 British sailors died. Britain supplied Native Americans who raided American settlers on the frontier, hindering American expansion and provoking resentment. Historians debate whether the desire to annex some or all of British North America (Canada) contributed to the American decision to go to war. On June 18, 1812, US President James Madison, after heavy pressure from the War Hawks in Congress, signed the American declaration of war into law.
With most of its army in Europe fighting Napoleon, Britain adopted a defensive strategy, with offensive operations initially limited to the border, and the western frontier. American prosecution of the war effort suffered from its unpopularity, especially in New England, where it was derogatorily referred to as "Mr. Madison's War". American defeats at the Siege of Detroit and the Battle of Queenston Heights thwarted attempts to seize Upper Canada, improving British morale. American attempts to invade Lower Canada and capture Montreal also failed. In 1813, the Americans won the Battle of Lake Erie, gaining control of the lake, and at the Battle of the Thames defeated Tecumseh's Confederacy, securing a primary war goal. A final American attempt to invade Canada was fought to a draw at the Battle of Lundy's Lane during the summer of 1814. At sea, the powerful Royal Navy blockaded American ports, cutting off trade and allowing the British to raid the coast at will. In 1814, one of these raids burned the capital, Washington, but the Americans later repulsed British attempts to invade New York and Maryland, ending invasions of the northern and mid-Atlantic United States from Canada.
Fighting also took place overseas in the Atlantic and Pacific oceans. In neighbouring Spanish Florida, a two-day battle for the city of Pensacola ended in Spanish surrender.
In Britain, there was mounting opposition to wartime taxation; merchants demanded to reopen trade with America. With the abdication of Napoleon, the war with France ended and Britain ceased impressment, rendering the issue of the impressment of American sailors moot. The British were then able to increase the strength of the blockade on the United States coast, annihilating American maritime trade, but attempts to invade the U.S. ended unsuccessfully, at which point both sides began to desire peace.
Peace negotiations began in August 1814, and the Treaty of Ghent was signed on December 24. News of the peace did not reach America for some time. Unaware of the treaty, British forces invaded Louisiana and were defeated at the Battle of New Orleans in January 1815. These late victories were viewed by Americans as having restored national honour, leading to the collapse of anti-war sentiment and the beginning of the Era of Good Feelings, a period of national unity. News of the treaty arrived shortly thereafter, halting military operations. The treaty was unanimously ratified by the US Senate on February 17, 1815, ending the war with no boundary changes.