Britain Will Pardon Thousands of Gay and Bisexual Men
Alan Turing broke the German Enigma code during World War II and devised the Turing machine and the Turing test of computer intelligence. Unabashedly gay, he committed suicide after being convicted of homosexual acts.
Credit: National Portrait Gallery, London

Editor's Note: This story was updated at 3:45 p.m. E.T.

Alan Turing, Oscar Wilde, Lord Edward Montagu.

Those are just some of the thousands of men who, over the course of about two centuries, were jailed for having same-sex relationships with men in Britain.

Now, Britain is reversing course and pardoning men who were convicted for same-sex offenses that are now considered legal. In addition to pardoning people posthumously, anyone who is still alive can also  formally apply to have his name cleared, according to the United Kingdom government website.

"It is hugely important that we pardon people convicted of historical sexual offenses who would be innocent of any crime today," Sam Gyimah, the parliamentary under secretary of state for prisons and probation, said in a statement from the U.K. government. [10 Milestones in Gay Rights History]

The new pardon is the culmination of a huge reversal for the country, which for centuries has harshly punished same-sex relationships. Britain outlawed sexual contact between men in 1533, when King Henry VIII made the offense punishable by death. In 1828, this law was repealed and replaced by the Offenses Against the Person Act, though same-sex intercourse between men was still eligible for the death sentence until 1861, according to "A Gay History of Britain: Love and Sex Between Men Since the Middle Ages," (Praeger, 2007). In 1895, the playwright Oscar Wilde was convicted for gross indecency after a love affair with Lord Alfred Douglas. Wilde was sentenced to hard labor, and spent the remaining years of his life as a pauper. In 1921, the law was updated to make same-sex acts between women illegal as well.

The impetus for the new move was set in motion when Queen Elizabeth II pardoned pioneering mathematician Alan Turing three years ago. Turing, who is considered one of the founding fathers of computer science, was a brilliant cryptographer who helped Britain win the war against Germany by cracking codes that were created by Germany's Enigma machine.

He also formulated the Turing Test, a method of determining whether artificial intelligence is acting in a truly intelligent way. However, Turing was also gay and lived at a time when sex between men was outlawed. He was prosecuted in 1952 for having sex with a man and was given the option of chemical castration with the hormone estrogen, or imprisonment, according to Turing.org. He chose the former, but committed suicide in 1954.

Just three years later, in 1957, the Wolfenden Report, which was commissioned by the Committee on Homosexual Offences and Prostitution, recommended that homosexuality not be a crime.  By 1967, the government had passed a law that decriminalized private sexual relations between men over the age of 21. Same-sex marriage was legalized in Britain (except Northern Ireland) in 2013.

Original article on Live Science.

Editor's Note: This story was updated to correct the queen of England's name. She is Queen Elizabeth II, not Queen Elizabeth III.