 He was a member of the Virginia House of Delegates from 1810 to 1817 and was appointed a lieutenant colonel of a Virginia regiment in the War of 1812.Mercer was later promoted to major in command at Norfolk, Virginia, was inspector general in 1814, aide-de-camp to Governor James Barbour and brigadier general in command of the 2nd Virginia Brigade.He was projector and first president of the Chesapeake & Ohio Canal Co. from 1828 to 1833 and was a delegate to the Virginia Constitutional Convention in 1829.