The immediate causes of the War of 1812 were a series of economic sanctions taken by the British and French against the US as part of the Napoleonic Wars and American outrage at the British practice of impressment, especially after the Chesapeake incident of 1807. In response to the 1806 British Orders in Council, which crippled American trade, the US (under Jefferson) first tried various retaliatory embargoes. These embargoes hurt the US far more than they did Britain, angering American citizens and providing support to War Hawks in Congress like Henry Clay. In 1812, with President Madison in office, Congress declared war against the British.
The war began with an attack on Canada, both as an effort to gain land and to cut off British supply lines to Tecumseh's Indian confederation, which had long troubled the US. The initial battles in Canada were not as easy as the War Hawks hoped, and the inexperienced American soldiers were pushed back rapidly. In fact, only by virtue of clutch naval victories by Oliver Hazard Perry on Lake Erie and Thomas Macdonough on Lake Champlain was a serious northern- front invasion of the United States, including New York, prevented. General William Henry Harrison's forces did manage to kill Tecumseh at the Battle of the Thames in 1813, in the midst of a decisive victory against the British General Isaac Brock's smaller force.
On the Mid-Atlantic Coast, British troops landed in the Chesapeake Bay area in 1814, and marched towards Washington. US General William Winder made an attempt to stop the British forces, commanded by General Robert Ross, at Bladensburg. The US troops were badly routed. The city of Washington was evacuated, and the British burned the Capitol and the White House, along with most of nonresidential Washington.
The British pressed onward, and Admiral Cochrane sought to invade Baltimore. General Ross was killed as his forces advanced towards the city, and their movement stalled. Cochrane's forces bombarded Fort McHenry, which guarded Baltimore's harbor, but were unable to take it. This event inspired Francis Scott Key, an American lawyer detained on one of Cochrane's ships, to write the Star-Spangled Banner. Unsuccessful at Baltimore, Cochrane's damaged fleet limped to Jamaica for repairs, and made preparations for an invasion of New Orleans, hoping to cut off American use of the Mississippi River.
By mid 1814, the War of 1812 was turning out to be tougher fighting than either side expected. Britain, caught up in the costly Napoleonic Wars, began to look for a way to extricate itself from its American commitment. In the Belgian city of Ghent, American negotiators (including John Quincy Adams and Henry Clay) met with British diplomats. After considerable bickering, the negotiators signed the Treaty of Ghent on December 24, 1814, officially ending the war. The treaty returned US-Britain relations to the same status as they had been before the war. The US neither gained nor lost any territory. Impressment went unaddressed.
The war was officially over, but news traveled slowly across the Atlantic Ocean. In New Orleans, Cochrane landed the British troops, who were still waiting for their replacement commander for Ross, General Packenham, to arrive from Britain. On January 8, 1815, Andrew Jackson's ragtag army soundly defeated the British at the Battle of New Orleans. Even though this battle had been fought unnecessarily (the treaty was already signed) the US celebrated wildly, manifesting an upsurge in American nationalism.
Although the war had sheltered New England manufacturing from British competition, New England merchant shipping had been seriously hurt, and a group of Federalists met at the Hartford Convention in late 1814 to discuss their grievances. A few talked of secession from the Union, but most just wanted to make it hard for the US to declare war or impose embargoes in the future. When the news of the treaty from Ghent arrived, it made the Federalists look silly, or even treasonous. The Hartford Convention spelled the end of the Federalist Party.