Hamilton contested Leeds North East at the 1992 general election but was defeated by the sitting Conservative MP Timothy Kirkhope by 4,244 votes, gaining a 5.9% swing from the Conservative Party to Labour. Despite having achieved the highest Labour swing in the North of England, the constituency Labour Party voted, by a margin of one vote, in favour of an all-women shortlist. Hamilton was quoted by The Independent as saying: Leeds North-East made its selection on 1 July 1995, selecting Liz Davies, a barrister and councillor in the London Borough of Islington. Davies defeated four local women, two of whom were Leeds city councillors. Her selection was vetoed by the National Executive Committee, allegedly for her left-wing politics; unhappy with the situation, opponents took out an unsuccessful private prosecution against Hamilton under the Companies Act in connection with his printing business. Hamilton won the subsequent selection process. He was elected to the House of Commons at the 1997 general election when he defeated Kirkhope by 6,959 votes. He made his maiden speech on 23 June 1997, in which he explained that his constituency stretches from the inner-city Leeds district of Chapeltown all the way out to Harewood House, the stately home of the Earls of Harewood. He is said to be the first MP to hold a virtual surgery for constituents who can go to his constituency office while he is in London, and converse via webcam. He was a signatory of an open letter to the then-Labour Party leader Ed Miliband in January 2015 calling on the party to commit to oppose further austerity, take rail franchises back into public ownership and strengthen collective bargaining arrangements Hamilton was re-elected as the MP for Leeds North East at the 2019 General Election with a 17,089 majority.
In Parliament he served as a member of the Administration Select committee 1997–2001, and has been a member of the Foreign Affairs Select Committee since the 2001 general election. He is also the chairman of the all party groups on business services, prison health, and civil contingency, he also serves as the vice-chairman of the all-party Iran group. He also chairs the All-Party Parliamentary Group for Tibet. On 7 January 2016, Hamilton was appointed a shadow Foreign Minister, outside the Shadow Cabinet. On 29 June 2016, Hamilton was appointed as Shadow Europe Minister to replace Pat Glass, who resigned over concerns about Corbyn's leadership. Hamilton resigned a few days later on 4 July 2016, saying that he was troubled by Corbyn's response to the Chakrabarti Inquiry into anti-Semitism. On 8 November 2016, Corbyn fulfilled a campaign pledge as Hamilton was appointed as Shadow Minister for Peace and Disarmament - the first time this role had been held. The role covers North Africa, the Middle East, North Korea and Labour Party policy on nuclear weapons. When elected Leader of the Labour Party, Sir Keir Starmer kept the role as Shadow Minister for Peace and Disarmament, with Hamilton continuing in the role.
Expenses scandal
In 2009 The Daily Telegraph reported that Hamilton had incorrectly claimed £3,000 on expenses for mortgage payments. In addition to the interest on the mortgage, which can be claimed as an expense, Hamilton claimed for interest on an equity release scheme on the house, which cannot. Hamilton responded in a statement that this was "a genuine mistake" and that the money was paid back when the error was discovered by the House of Commons Fees Office. The Telegraph also accused Hamilton of "flipping" his second home designation to decorate and furnish both his constituency home in Leeds and London flat. Hamilton defended his actions and accused the Daily Telegraph of "deliberately misrepresenting" him.
Personal life
He married Rosemary in 1980: they have two daughters and a son. He is a keen cyclist, and once cycled to Aachen, Germany, raising funds for the Funzi and Bodo Trust, a children's charity based in Kenya. He speaks fluent French. As a result of mergers, he has successively been a member of Graphical, Paper and Media Union, Amicus and Unite.