LONDON (Reuters Life!) - British Prime Minister Gordon Brown apologized on Friday for the treatment of World War Two codebreaker Alan Turing who committed suicide after being convicted and chemically castrated for being a homosexual.
Mathematician Turing led a team at Bletchley Park country House north of London which cracked the Nazis' Enigma code -- regarded by the Germans as unbreakable -- a move credited with helping to shorten the war and save countless lives.
However, five years after the war he was convicted of gross indecency under laws which banned homosexuality and was sentenced to chemical castration involving a series of injections of female hormones.
The conviction meant Turing, a pioneer of modern computing, losing his security clearance and being unable to continue his work. In 1954 he killed himself at the age of 41.
Following a petition signed by more than 30,000 people on the website of Brown's Downing Street office, calling for an apology, Brown issued a statement expressing the government's sorrow for Turing's "appalling" treatment.
"It is no exaggeration to say that, without his outstanding contribution, the history of World War Two could well have been very different," Brown said.
"The debt of gratitude he is owed makes it all the more horrifying, therefore, that he was treated so inhumanely."
Turing, Brown said, had deserved "so much better."
"While Turing was dealt with under the law of the time and we can't put the clock back, his treatment was of course utterly unfair and I am pleased to have the chance to say how deeply sorry I and we all are for what happened to him," he said.
"Alan and the many thousands of other gay men who were convicted as he was convicted under homophobic laws, were treated terribly."
The legislation used against the maths genius was the same as that used to prosecute and jail playwright Oscar Wilde in 1895 during a Victorian clampdown on homosexuality and it was only repealed in 2003, gay rights campaigners said.
Computer programer Dr John Graham-Cumming, who organized the online petition for Turing, said he had been surprised by the support he had received and the government's response.
"I wanted Alan Turing to be raised into the pantheon of great Britons, but I felt it would be hypocritical to do so without recognizing that Britain treated him so badly," he told Reuters.
He has written to Queen Elizabeth to ask her to grant Turing a posthumous knighthood for his wartime work and called for the government to provide investment to preserve Bletchley Park and set up a National Museum of Computing there in Turing's name.
It was at the site that Turing and fellow scientists designed and developed Colossus, a truck-sized machine which was one of the world's first programmable electronic computers.
However the work was not widely known beyond academic circles as Britain kept their role in the war secret.
Then Prime Minister Winston Churchill ordered that the Colossus computers and 200 so-called Bombe machines, used to crack the Enigma code, be destroyed to keep them secret from the Soviet Union.
Bletchley's existence only came to light in the 1970s when the veil of secrecy was lifted.
Editing by Steve Addison