In August 1814, the British landed a large force on the shores of Chesapeake Bay and routed Winder's army at the Battle of Bladensburg.[198] The Madisons escaped capture by fleeing to Virginia by horseback, however, the British captured Washington and burned many of its buildings.[199][200] The charred remains of the capital signified a humiliating defeat for Madison and America.[201] The British army next moved on Baltimore, but the U.S. repelled the British attack in the Battle of Baltimore, and the British army departed from the Chesapeake region in September.[202] That same month, U.S. forces repelled a British invasion from Canada with a victory at the Battle of Plattsburgh.[203] The British public began to turn against the war in North America, and British leaders began to look for a quick exit from the conflict.[204]
In January 1815, Jackson's troops defeated the British at the Battle of New Orleans.[205] Just more than a month later, Madison learned that his negotiators led by John Quincy Adams had concluded the Treaty of Ghent on December 24, 1814 which ended the war.[206] Madison quickly sent the treaty to the Senate, which ratified it on February 16, 1815.