In 1812, Ogden was elected as Governor of New Jersey in a wave of Federalist victories across the state due to opposition to the War of 1812. Ogden had been nominated by his Federalist colleagues as governor many times before, but the Republican majority who elected the governor held the majority from 1803 to 1812. During his term as Governor, "funds were secured for the military's use in the war against Britain." After running unsuccessfully for reelection, the Federalists were voted out of the majority and with them, Ogden retired from political life. Ogden was nominated by President James Madison as major general of the Army in 1813, but declined the appointment.