The British government has given Alan Turing a posthumous pardon.

According to the AP, the pardon was officially granted by Queen Elizabeth II on Tuesday.

Turing, described as a brilliant mathematician, helped crack the German Enigma machine code – a triumph of computer science and a turning point for the Allies in World War II.

He died an early death for acknowledging that he was gay. In 1952, Turing and Arnold Murray were charged with gross indecency after Turing disclosed their relationship to detectives investigating a break in at Turing's Manchester home. Turing was convicted and given the choice of going to prison or submitting to a form of chemical castration via estrogen hormone injections. He chose the latter. The therapy left him impotent and he developed breasts.

It is widely believed that he committed suicide two years after his arrest by eating a cyanide-laced apple.

“He helped preserve our liberty,” lawmaker Iain Stewart, who lobbied for the pardon, told the AP. “We owe it to him in recognition of what he did for the country – and indeed the free world – that his name should be cleared.”