The Enigma codebreaker Alan Turing is set to be posthumously pardoned, after the Government said it would not stand in the way of legislation in parliament that would quash his conviction for being a homosexual.

Ministers had previously argued that they would not be able to go any further than the apology given by Gordon Brown in 2009, because “gross indecency”, which Turing was found guilty of in 1952, was at the time a criminal offence.

But yesterday Government Whip Lord Ahmad of Wimbledon said the coalition would not stand in the way of a Bill brought by Liberal Democrat peer Lord Sharkey, which offers Turing a full posthumous parliamentary pardon.

Download the new Independent Premium app Sharing the full story, not just the headlines

Shortly before the Alan Turing (Statutory Pardon) Bill received an unopposed second reading in the House of Lords, Lord Ahmad said: “Alan Turing himself believed that homosexual activity would be made legal by a Royal Commission.

"In fact, appropriately, it was Parliament which decriminalised the activity for which he was convicted. The Government therefore is very aware of the cause to pardon Turing given his outstanding achievement and has great sympathy with the objective of the Bill.

“That is why the Government believes it is right that Parliament should be free to respond to this Bill in whatever way its conscience dictates, in whatever way Parliament so wills.”

He added: “If nobody tables an amendment to this Bill, the supporters can be assured that this Bill will make speedy progress and passage to the House of Commons.”

It is widely accepted by experts that Turing’s work shortened the Second World War by two years, saving possibly hundreds of thousands of lives, and preventing starvation throughout Britain by revealing the location of U-Boats that were intercepting merchant ships.

Earlier Lord Sharkey, who was taught mathematics at university by Turing's close friend Robin Gandy, said: "The Government knows that Turing was a hero and a very great man.

“They acknowledge that he was cruelly treated. They must have seen the esteem in which he is held here and around the world.

"It is not too late for the Government to pardon Alan Turing. It is not too late for the Government to grant a disregard for all those gay men convicted under the dreadful (legislation). I hope the Government is thinking very hard about doing both of those things.

“But while they are thinking, Parliament can act.”