The head of the Government Communications Headquarters has expressed regret at the way Alan Turing, a gay World War Two codebreaker, was treated in the years leading up to his suicide.

Iain Lobban, Head of GCHQ, made a speech to a crowd in Leeds commemorating a hundred years since Mr Turing’s birth, reports the Guardian.

Mr Lobban described Alan Turing as “one of our greatest minds”, and said that the UK was robbed by his death. He also said that more people like Turing were needed to keep abreast of threats posed by the advancement of new technologies and cybercrime.

He said that sometimes the people the country needs do not fit “social stereotypes”, and that it was his job to enable those people to work in the world of secret intelligence.

He said: “I want to apply and exploit their talent. In return, I think it’s fair that I don’t need to tell them how to live their lives.

“We can’t rewrite the past,” he said. “We can’t wish mid-20th century Britain into a different society with different attitudes.

“We can be glad that we live in a more tolerant age. And we should remember that the cost of intolerance towards Alan Turing was his loss to the nation.”

Gordon Brown, then prime minister, apologised in 2009 for the treatment and marginalisation of Mr Turing, who committed suicide in 1954, two years after being convicted of homosexuality, which was then a crime.

Iain Lobban said that Mr Turing, nicknamed “The Prof” at Bletchley Park, the home of the Enigma code-breakers, was successful because the operation there was not concerned with his sexuality.

He said that managers today should make “space for the unique and different contribution that each person makes.”

“I strongly believe [the] agency needs the widest range of skills possible if it is to be successful, and to deny itself talent just because the person with the talent doesn’t conform to a social stereotype is to starve itself of what it needs to thrive.”

He looked to the future, and said that schoolchildren should be encouraged to study maths and science, in order to “find tomorrow’s Turings.”

Mr Lobban also addressed the fact that Mr Turing is often referred to as having been “eccentri”‘, and said: “Turing was not an eccentric, unless you believe that there is only one way of being normal and to be otherwise is to be peculiar. Turing wasn’t eccentric: he was unique.”