In 1813, President James Madison sent Gallatin to St. Petersburg, Russia to serve as a negotiator for a peace agreement to end the War of 1812. He was one of four American commissioners who would negotiate the treaty, serving alongside Henry Clay, James Bayard, Jonathan Russell, and John Quincy Adams. Efforts at starting negotiations in Russia quickly collapsed. While waiting abroad in the hope of future negotiations, Gallatin was replaced as Secretary of the Treasury by George W. Campbell, with the expectation that Gallatin would take up his old post upon his return to the United States. Negotiations with the British finally commenced in Ghent in mid-1814.