After his naval career, Hamilton saw a place in parliament as a way of finding favour with the Government and hopefully a lucrative office. At the 1708 general election, Hamilton stood for Parliament at Great Marlow, and also at the family seat of Lanarkshire. He was defeated at Marlow, but was returned in a hard-fought contest as Member of parliament (MP) for Lanarkshire. He opposed the Treason Act of 1709, which altered Scottish law in direct contravention of the safeguards included in the Union, but his opposition was short lived as he sought payment for arrears with his pension. He supported the ministry in the vote for the impeachment of Dr Sacheverell and with the support of the Duke of Marlborough was appointed Governor of Jamaica in May 1710.