London - Thousands of men convicted under now-abolished anti-homosexuality laws in Britain have been pardoned posthumously under a law passed on Tuesday, and many more still alive can now apply to have their criminal convictions wiped out.Announcing the new law, the Ministry of Justice said the pardons apply automatically to deceased men who were convicted for consensual same-sex relations before homosexuality was decriminalised several decades ago. Men living with convictions can apply to the government to have their names cleared."This is a truly momentous day. We can never undo the hurt caused, but we have apologised and taken action to right these wrongs," Justice Minister Sam Gyimah said.Calls for a general pardon have noted the 1954 suicide of World War II codebreaking hero Alan Turing after his conviction for "gross indecency." After he received a posthumous royal pardon in 2013, pressure for pardons intensified.Turing, a computer science pioneer, helped crack Nazi Germany's secret codes by creating the "Turing bombe," a forerunner of modern computers. His work helped shorten World War II, and he was an innovator of artificial intelligence.After the war, Turing was prosecuted for having sex with a man, stripped of his security clearance and forcibly treated with female hormones. He died at age 41 after eating an apple laced with cyanide.What is now known as "Turing's law" had been a longstanding government commitment, Gyimah said. It is part of the Policing and Crime Bill which received royal approval on Tuesday.In its announcement, the ministry said that as well as posthumously pardoning gay and bisexual men, the law allows those still living, and who were convicted in cases of consensual sex with other men of legal age, to apply for pardons."This will ensure that due diligence is carried out and prevent people from claiming to be cleared of offences that are still crimes, including sex with a minor and non-consensual sexual activity," it said.