LONDON — The head of Britain's digital espionage agency has apologized for the organization's historic prejudice against homosexuals, saying it failed to learn from the treatment of World War II codebreaker Alan Turing.
Related: $1M Turing Award Goes to Pioneers of Internet Encryption
In a rare public speech, GCHQ chief Robert Hannigan told a gathering organized by the rights group Stonewall that the agency's ban on homosexuals had caused long-lasting psychological damage to many and hurt the agency because talented people were excluded from working there.

"The fact that it was common practice for decades reflected the intolerance of the times and the pressures of the Cold War, but it does not make it any less wrong and we should apologize for it," Hannigan said Friday at the conference organized by Stonewall, which campaigns for lesbian, gay, bisexual and transgender equality.
The speech offered a poignant tribute to Turing, the gay computer science pioneer and architect of the effort to crack Nazi Germany's Enigma cipher. Turing was convicted of indecency in 1952 and stripped of his security clearance. He later committed suicide.
Related: Alan Turing's Enigma-Breaking Notes Found in Roof Insulation
A 2014 film about Turing, "The Imitation Game " starring Benedict Cumberbatch, brought his story to a new generation. At GCHQ, Turing is now seen as a genius— "a problem-solver who was not afraid to think differently and radically," Hannigan said.
It was partly to honor Turing that the agency's headquarters was lit up during a global celebration of gender and sexual diversity last year.
"It was also kind of an act of atonement — for the lost opportunity of his early death," Hannigan said. "Who knows what Turing would have gone on to do, where, for example, he might have taken his pioneering interest in artificial intelligence, which is the thing everyone is talking about. We will never know and should, as a society, never repeat that mistake."