LONDON — Nearly 60 years after his death, Alan Turing, the British scientist whose code-breaking work helped the Allies beat Adolf Hitler and whom many consider the father of artificial intelligence, received a royal pardon Tuesday for the crime of having had sex with another man.
Turing felt humiliated after he was convicted in 1952 of "gross indecency," the charge used against gay men in an age when homosexual relations were illegal in Britain. He underwent chemical castration and his government security clearance was confiscated. He took his own life in 1954 at age 41, ending a distinguished career that pioneered today's computer era.
In recent years, a campaign to have Turing's name cleared has gained momentum, resulting in an official apology in 2009 and culminating in the announcement Tuesday that Queen Elizabeth II, exercising her royal "prerogative of mercy," had pardoned Turing at the request of the government.
The decision was hailed by many as long-overdue redress for one of Britain's most brilliant scientists, in keeping with advances in gay rights across much of the Western world.
"Dr. Turing deserves to be remembered and recognized for his fantastic contribution to the war effort and his legacy to science," Justice Secretary Chris Grayling said. "A pardon from the queen is a fitting tribute to an exceptional man."
Prime Minister David Cameron on Tuesday lauded Turing's vital work in cracking the Nazis' ingenious "Enigma" code, which had stumped some of the Allies' best cryptographers. Deciphering the German military's secret communications shortened World War II and "saved countless lives," Cameron said.
Turing is also remembered for his path-breaking thinking on artificial intelligence and the idea that a machine could be programmed to perform multiple tasks. Long before the creation of modern computers, he developed the "Turing test," an influential framework for determining whether a machine could be described as intelligent.
But his conviction on charges of gross indecency shut down his career and subjected him to disgrace and appalling treatment. Forced to take hormones to sap his sex drive, Turing was stripped of his clearance for government intelligence work and became bitter and depressed.
His death two years later from cyanide poisoning was ruled a suicide, though some of his friends and colleagues insisted it was an accident, and a few others muttered darkly of a plot by secret agents to kill him.
Thousands of other men not fortunate enough to be as famous as Turing remain on the books as criminals for being gay. Britain did not legalize gay sex until 1967, a decade after a controversial government-commissioned report on "homosexual offenses" said that sex between two consenting adults was a matter of individual freedom and privacy.
Turing's story has been much-written about and dramatized for stage and screen. The play "Breaking the Code" won critical acclaim in the West End and on Broadway in the 1980s; a new musical based on Turing's life and work, "The Universal Machine," premiered in London this year. Shooting has begun on a film about Turing, "The Imitation Game," starring Benedict Cumberbatch and Keira Knightley.
His posthumous pardon is highly unusual and possibly unique. Royal pardons have normally been reserved for people who were innocent of the offenses they were convicted of committing, most requested by family members or close associates. Neither is true in this case, a departure from protocol that reflects "the exceptional nature of Alan Turing's achievements," the government said.
That sits uneasily with some legal scholars. Although it's fine to denounce past statutes, such as the one against homosexuality, as retrograde and unjust, critics say, Turing was convicted according to the law of the land at the time, and pardoning him alone could be seen as implying that some people are above the law by virtue of their fame, their accomplishments or their value to the state.
Indeed, last year the government had rejected a petition to exonerate the Princeton-educated Turing on those very grounds.
"It is tragic that Alan Turing was convicted of an offense which now seems both cruel and absurd," then-Justice Minister Tom McNally said. "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."
Undeterred, supporters such as scientist Stephen Hawking continued to press Turing's cause. But just why the government reversed its previous decision is unclear.
Turing would no doubt be pleasantly surprised, perhaps even amazed, by how Britain has changed in the last half a century. Not only do many of his compatriots now walk around with powerful multi-function machines in their pockets (otherwise known as smartphones), but Parliament has also legalized same-sex marriage, with the first nuptials to take place next year.
Peter Tatchell, Britain's most prominent gay rights advocate, said that at least 50,000 men were convicted of gross indecency, and that as many as 15,000 of them are still living with criminal records for being gay. Some observers speculate that the government has avoided voiding those convictions because it might be on the hook to grant those men financial compensation.
"They have never been offered a pardon and will never get one. Selective redress is a bad way to remedy a historic injustice," Tatchell said. "An apology and pardon is due to the other 50,000-plus men who were also convicted of consenting, victimless homosexual relationships during the 20th century."