Hamilton became a lieutenant colonel of Lloyd's Regiment of Enniskillen Foot in June 1689 and, having been promoted to brevet colonel, commanded the regiment at the Battle of the Boyne in July 1690, at the siege of Athlone in June 1691 and at the Battle of Aughrim, where he was wounded, in July 1691 during the Williamite War in Ireland. He also commanded the regiment at the siege of Limerick in October 1691 and then became colonel of the Royal Fusiliers in January 1692 before fighting with that regiment at the Battle of Steenkerque in August 1692 in the Low Countries during the Nine Years' War. Rewarded with the colonelcy of the 1st Regiment of Foot in late 1692, he participated in further battles in Ireland before returning to the continent to fight at the Battle of Landen in July 1693 and at the siege of Namur, where he was wounded, in July 1695 during the latter stages of the Nine Years' War.