A pardon may be given to late gay codebreaker Alan Turing as peers in the House of Lords gave a bill to to just that its Second Reading today.

The Alan Turing (Statutory Pardon) Bill was introduced in the House of Lords for its first reading in May by Liberal Democrat peer Lord (John) Sharkey.

On Friday peers demanded that he be given the pardon, as the bill went through its Second Reading.

Lord Ahmad of Wimbledon, a government whip, said the Government would support the bill once it goes to the House of Commons, meaning that Alan Turing should be granted a pardon.

“When his country needed him he stepped forward and he played his part to ensure the democracy and the freedoms we all enjoy today,” he said.

If Turing was still alive, he would be eligible to erase his criminal record of historic gay sex crimes. David Cameron first made the pledge to wipe criminal records on PinkNews.co.uk in 2010.

Lord Sharkey said that Turing had been subjected to “terrible cruelty” and said that the UK and its Government owe him a debt. “The government knows that Turing is a hero and a very great man, they acknowledge he was cruelly treated,” he said.

Conservative peer Baroness Trumpington who also worked at Bletchley Park during World War II, offered her support for the bill.

“This is not about legal issues but about recognising the debt that this country owes to Alan Turing,” she said.

“I cannot claim that I knew him but I am certain that, but for his work, we would have lost the war through starvation.”

Labour peer Baroness Dean speculated on further benefits the UK would have had if Turing had lived, and noting an apology by then Prime Minister Gordon Brown in 2009, saying it was “not enough”.

MP for Manchester Withington John Leech has led the campaign for Alan Turing to be granted a posthumous pardon.

He said: “Given that all party support for the campaign, I am confident the bill will be passed in the Commons. The persecution by the state for being gay is a scandal that shouldn’t be allowed to stand and it is only right that we are pushing for this posthumous pardon. Alan Turing was a Manchester hero and a national hero. He helped shorten the war and was then persecuted by the state for his sexuality. He should be pardoned and this would be a fitting way of saluting his memory.”

The gay mathematical genius and codebreaker was the effective inventor of the modern computer and a key driver behind the victory over the Nazis.

He killed himself in 1952, two years after being sentenced to chemical castration.

Justice Minister Lord McNally last year said of the prospect of a pardon: “A posthumous pardon was not considered appropriate as Alan Turing was properly convicted of what at the time was a criminal offence. He would have known that his offence was against the law and that he would be prosecuted.

“It is tragic that Alan Turing was convicted of an offence which now seems both cruel and absurd – particularly poignant given his outstanding contribution to the war effort.

“However, the law at the time required a prosecution and, as such, long-standing policy has been to accept that such convictions took place and, rather than trying to alter the historical context and to put right what cannot be put right, ensure instead that we never again return to those times.”

In 2009, after a campaign led by Richard Dawkins, Stephen Fry and Peter Tatchell and supported by PinkNews.co.uk, the then prime minister Gordon Brown issue an apology for Turing’s treatment on behalf of the British government.

Speaking last year Liberal Democrat peer, Lord Sharkey, said he said it would give Turing the pardon he “so clearly deserves”.