[1] On 14 April 1697, he was created Earl of Ruglen, Viscount of Riccartoun and Lord Hillhouse in the Peerage of Scotland by William III of England.
They had three children: The Earl married secondly, at Edinburgh, on 22 March 1701, Elizabeth Hutchinson Kennedy, the daughter of Charles Hutchinson of Owthorpe, Nottinghamshire, and widow of John, Lord Kennedy, his first wife's eldest brother.
[1] The Earldom of Selkirk, which could only pass through the male line, was inherited by his great-nephew, the grandson of his brother Lord Basil.
His eldest daughter, Lady Anne Hamilton, succeeded as Countess of Ruglen.
Her only son, William Douglas, 4th Duke of Queensberry, became the 3rd Earl of Ruglen but died childless, and the earldom became extinct.