He was appointed an ensign in the 84th Regiment of Foot on 1April 1794 then removed to the 30th Regiment of Foot on the 2April 1797. Promotions followed to lieutenant on 22March 1791; to captain on 2September 1795; to major on 1April 1804; to lieutenant-colonel in the army on 4June 1811 and lieutenant-colonel of the 2nd Battalion, 30th Foot on 25July 1811. Hamilton was present at the landing of the British troops at Toulon in August 1793 and was severely wounded at Cape Brune on the 14October the same year. In January 1794 he was part of the expedition to Corsica where he led the attack on the Martello tower on the first landing and was present at the taking of St. Fiorenza and the Siege of Bastia. Hamilton next saw action on 14March and 2July as commander of a detachment of the 30th Foot acting as marines aboard under George Campbell; he was subsequently thanked by Cambell for his assistance in quelling a mutiny amongst the crew of the ship. Appointed Brigade Major to Brigadier-General Thomas Graham, Hamilton was present at the Siege of Malta then joined the Expedition to Egypt under Lieutenant-General Sir Ralph Abercromby. While in Egypt he was thanked by Lieutenant-General Sir John Doylein public orders for his conduct in the engagements of the 13 and 21 March and 17August 1801. Hamilton then commanded several light infantry battalions in Ireland before his regiment joined Wellington's army in Portugal. He was present at the Siege of Cádiz during the Peninsular War, commanded the battalion at the 1811 Battle of Fuentes de Oñoro and after promotion to Lieutenant Colonel, again commanded his battalion at the Battle of Salamanca the following year. He received the thanks of Lieutenant GeneralSir Thomas Picton for his services at Quatre Bras where he was seriously injured in the leg. A tourniquet was applied in preparation for amputation three times but on each occasion the surgeon was called away and it was decided to let the leg recover on its own. On the recommendation of Wellington he was made a Companion of the Order of the Bath on 22June 1815 for his services at Quatre Bras and Waterloo. He died at Woolwich, London on 4June, 1838 and is buried in the now vanished St Luke's Churchyard in Charlton, Kent.