He also practiced as a doctor despite his lack of qualifications, and in 1877 was a surgeon to the hospital at the Hodgkinson gold rush, where he attracted publicity with a public dispute with the local warden and a successful defamation case after allegations that he seduced the daughter of a friend of the local editor.
In 1878 he was elected to the Legislative Assembly of Queensland for Gympie and supported Thomas McIlwraith's conservative group.
In 1883 he changed seat to Cook, winning the election amid allegations of vote rigging.
[1] Hamilton supported the North Queensland separatist movement and continued to support McIlwraith's conservative successors, becoming a significant but occasionally rebellious backbencher, successfully opposing the attempted reduction of parliamentary salaries in 1893 and defeating the nomination of Alfred Cowley as Speaker in 1899.
Following his defeat he retired, and died in 1916 at the Royal Brisbane Hospital,[1] having never married and was buried at Toowong Cemetery.