In the American War of Independence (1775–1783), Hamilton fought in the Invasion of Canada and the Battle of Freeman's Farm, commanding the middle column during the latter.
While a prisoner of war, he adopted James Hamilton, the son of a non-commissioned officer in the British Army.
Under the 15th Regiment of Foot, Hamilton participated in Battle of Martinique as well as the Invasion of Guadeloupe in the French Revolutionary Wars.
[5] He first saw action in June 1756 at the Siege of Fort St Philip, part of the Seven Years' War.
During the siege, Admiral John Byng sailed there with a relief group, hoping to save the island for the British, but was unsuccessful.
[12] British ships retreated after seeing a large French force, but sailed around the coast for a few weeks seeking another place to attack.
[13] In 1761, Hamilton took part in the Capture of Belle Île[6] as one of the 5,000 British troops led by Studholme Hodgson.
[19] In 1774, Hamilton commanded the 21st Regiment of Foot in the American War of Independence;[20] General John Burgoyne said that he "was the whole time engaged and acquitted himself with great honor, activity, and good conduct.
"[21] Early in 1776, while in the 21st Regiment, Hamilton accompanied General Guy Carleton in the British response to the Continental Army's 1775 invasion of Quebec.
[19] Hamilton helped General Burgoyne organize troops for his campaign to divide the rebellious provinces.
[19] On 19 September 1777, in Stillwater, New York, Hamilton commanded 1,100 men of the centre column, consisting of the 9th, 20th, 21st, and 62nd Regiments of Foot, which attacked the heights at the Battle of Freeman's Farm.
[25] To Hamilton's right, Simon Fraser commanded the 24th Regiment of Foot along with light infantry and grenadiers.
[27] Burgoyne had gained the field of battle, but suffered nearly 600 casualties,[27] mostly in Hamilton's centre column, where the 62nd was reduced to the size of a single company and three-quarters of the artillery men were killed or wounded.
[36] After his exchange, Hamilton returned to Britain,[32] where he funded his adopted son's education at Glasgow University.
[37] Around 1790, Hamilton made various renovations to Murdostoun: filling the turret staircase and the old dungeons, adding a parapet running round the roof-line, and changing the original courtyard.