Thousands of gay and bisexual men found guilty of decades-old sexual offences in England and Wales have been posthumously pardoned.
The enactment by the UK government of the so-called Alan Turing law means about 49,000 men will be cleared of crimes of which they would be innocent today.
Wartime code-breaker Mr Turing was pardoned in 2013 for gross indecency.
Statutory pardons will also be granted to people still living who apply to have their convictions removed.
The pardons were first announced last year and have now been officially rubber-stamped after the Policing and Crime Bill received Royal Assent.
The men were found guilty of committing now-abolished offences while in consensual relationships.
Justice Minister Sam Gyimah said it was a truly momentous day.
"We can never undo the hurt caused, but we have apologised and taken action to right these wrongs," he said.
Mathematician Mr Turing was given a royal pardon in 2013, nearly 60 years after his suicide in 1954.
The pardon addressed his 1952 conviction for gross indecency, after which he was chemically castrated.
This followed an official apology by former UK Prime Minister Gordon Brown in 2009 for how Mr Turing had been treated.
His relatives later mounted a high-profile campaign to secure pardons for other men similarly convicted under historical indecency laws.
Gay rights charity Stonewall said: "Another important milestone of equality has been secured in law.
"The more equality is enshrined into our law books, the stronger our equality becomes, and the stronger we as a community become."
In New Zealand, a petition was presented to Parliament last year seeking an official pardon for for men convicted before the Homosexual Law Reform Bill was passed in 1986, and for the convictions to be overturned.
Justice Minister Amy Adams said at the time the government would consider it but would probably address each case as it stood, rather than wiping all convictions at once. She said the old law had not distinguished between consensual and non-consensual acts, and some of the convictions would still stand today, such as those relating to children.