Gordon Brown issued an unequivocal apology last night on behalf of the government to Alan Turing, the second world war codebreaker who took his own life 55 years ago after being sentenced to chemical castration for being gay.

Describing Turing's treatment as "horrifying" and "utterly unfair", Brown said the country owed the brilliant mathematician a huge debt. He was proud, he said, to offer an official apology. "We're sorry, you deserved so much better," Brown writes in a statement posted on the No 10 website.