 Hamilton was baptized on 17 February 1673, the youngest son of William Douglas-Hamilton, Duke of Hamilton and Anne Hamilton, 3rd Duchess of Hamilton, Hamilton studied at Glasgow University and was then sent to study under the Astronomer Royal, John Flamsteed, in London before taking a commission in the Royal Navy aboard the third-rate .Promoted to post-captain on 11 September 1693, he was given command of the fifth-rate in 1694 and of the fourth-rate in 1697.In December 1695 he was active in the English Channel pursuing French privateers, including "Tyger" out of St Malo, an encounter commemorated in a painting by Willem van de Velde the Younger.