LONDON/MOSCOW, December 24 (RAPSI) – Queen Elizabeth II on Monday pardoned Alan Turing, the British mathematician who broke the Enigma code, for his conviction on charges of homosexuality 61 years ago.

The Enigma code was used by the German Navy during WWII, and the names of Turing and his group who unscrambled it were made public only in 1974, when the results of their work were declassified. Experts believe that Turing’s work shortened the Second World War by two years.

Turing was convicted of gross indecency in 1952 after admitting a sexual relationship with a man, a criminal offense in Britain at the time. He was offered to choose between a term in prison and chemical castration by a series of injections of female hormones. He chose the latter. Two years later, he died after eating a cyanide-laced apple. The coroner ruled that it was suicide, but questions over this version of events have persisted to this day.

Homosexuality was removed from the list of criminal offences in 1967.

Many people waged a long campaign to clear Turing’s name, backed by MPs and leading scientists, including physicist Stephen Hawking. In 2009, then Prime Minister Gordon Brown issued an “unequivocal apology” to Turing.

Thousands of people signed petitions to pardon the late genius, but the answer was that a pardon is granted in Britain only when the person is innocent of the offence and if a request has been made by someone with a vested interest, such as a family member. Turing could not be pardoned because he was properly convicted of what at the time was a criminal offence.

However, he has eventually been pardoned without either requirement being met, under the Royal Prerogative of Mercy by the Queen, following a request from the justice secretary.

Turing also made significant contributions to the emerging field of artificial intelligence and computing. After the war, he worked on the Manchester Mark 1, one of the first recognizable modern computers.