He was the eldest son of Robert Hamilton, Lord Presmennan. Having married Margaret, granddaughter of John Hamilton, 1st Lord Belhaven and Stenton; who had been made a peer by Charles I in 1647, he succeeded to this title in 1679. In 1681, he was imprisoned for opposing the government and for speaking slightingly of James, duke of York, afterwards James VII and II, in parliament, and in 1689 he was among those who asked William of Orange to undertake the government of Scotland. Belhaven was at the Battle of Killiecrankie in 1689. He was a member of the Scottish privy council. He was a director of and invested heavily in the Scottish Trading Company, which was formed in 1695 and was responsible for the ill-fated Darien scheme to set up a Scots colony on the Darien peninsula in Panama. He was also a proponent of agricultural improvement publishing a handbook, The Countryman's Rudiments in 1699. He favoured the agitation for securing greater liberty for his country, an agitation which culminated in the passing of the Act of Security in 1705, and he greatly disliked the union of the parliaments, a speech which he delivered against this proposal in November 1706 attracting much notice. He was, along with Andrew Fletcher of Saltoun, one of the most eloquent of politicians. Two of his speeches, one being the famous one of November 1706, were published in an appendix to Daniel Defoe's History of the Union. Later he was imprisoned, ostensibly for favouring a projected French invasion, and he died in London on 21 June 1708. Belhaven's son, John, who fought on the British Government side at the Battle of Sheriffmuir, became the 3rd Lord on his father's death. He was drowned in November 1721, whilst proceeding to take up his duties as governor of Barbados, and was succeeded by his son John. After the death of John's brother James in 1777 the title was for a time dormant; then in 1799 the House of Lords declared that William Hamilton, a descendant of John Hamilton, the paternal great-grandfather of the 2nd Lord, was entitled to the dignity. William, who became the 7th Lord, was succeeded by his son Robert, who was created a peer of the United Kingdom as Baron Hamilton of Wishaw in 1831. He died without issue in December 1868, when the barony of Hamilton became extinct; in 1875 the House of Lords declared that his cousin, James Hamilton was rightfully Lord Belhaven and Stenton, and the title descended to his kinsman, Alexander Charles, the 10th Lord.