In 1811 Barton was gazetted as an ensign in the 87th (The Prince of Wales's Irish) Regiment of Foot and in 1813 was transferred to the 1st Regiment of Foot Guards, where he was promoted to Lieutenant and Captain in 1815. He served in the Napoleonic Wars and was wounded in the Battle of Quatre Bras. In 1826 he participated in the British expedition to Portugal in the First Miguelist War, under the command of General Sir William Henry Clinton. He resigned his commission from the military in July 1833.