Promoted to major general on 9 March 1702, Hamilton fought under John Churchill, 1st Duke of Marlborough at the siege of Stevensweert in October 1702 during the War of the Spanish Succession. Promoted to lieutenant general on 1 January 1704, he was appointed a Knight of the Order of the Thistle later that year. He led the final assault at the Battle of Blenheim attacking the village churchyard with eight battalions of men and then receiving the surrender of its French defenders in August 1704. After marching his column from the Moselle, he relieved the besieged city of Liège in June 1705.