Hamilton was elected to the British House of Commons in 1983. After being implicated (alongside Tim Smith) in the cash-for-questions affair, Hamilton became widely associated with sleaze; he was defeated in the 1997 general election, and subsequently left politics. He left the Conservative Party in 2002, and joined UKIP. He was elected to the National Executive Committee of UKIP in 2011. Following his election to the National Assembly for Wales, he was UKIP Assembly Group Leader from 2016 to 2018 and again from 2019. He has been Leader of UKIP Wales since 26 September 2016.