Difficult as it was for them to join forces, they nominated Clinton for President and Jared Ingersoll, a Philadelphia lawyer, for vice president.[32] Hoping to shore up his support in the Northeast, where the War of 1812 was unpopular, Madison selected Governor Elbridge Gerry of Massachusetts as his running mate,[188] though Gerry would only survive two years after the election due to advanced old age.[189] Despite the maneuverings of Clinton and the Federalists, Madison won re-election, though by the narrowest margin of any election since that of 1800 in the popular vote as later supported by the electoral vote as well. He received 128 electoral votes to 89 for Clinton.[190] With Clinton winning most of the Northeast, Madison won Pennsylvania in addition to having swept the South and the West which ensured his victory.[191][192]

The British set ablaze the U.S. Capital while Madison was President on August 24, 1814.
After the disastrous start to the war, Madison accepted Russia's invitation to arbitrate, and sent a delegation led by Gallatin and John Quincy Adams (the first son of former President John Adams) to Europe to negotiate a peace treaty.