Men convicted for having gay relationships under old discriminatory laws will be given a full pardon, the Scottish Government has announced.
Justice Secretary Michael Matheson said the government will introduce legislation to automatically absolve men convicted of same-sex sexual activity that is now lawful.
Civil servants are also in talks with Police Scotland to investigate how to wipe the convictions from criminal records.
Mr Matheson told MSPs it is “shocking” that consensual sex between men was only decriminalised in 1980.
“Such laws clearly have no place in a modern and inclusive Scotland,” he said.
“However, there are people with criminal convictions for same-sex sexual activity that is now lawful and we must right this wrong.
“We will introduce an automatic formal pardon for those convicted under these discriminatory laws so they know they are absolved fully.
“We want to address the injustice that people experienced simply because of their sexual orientation in circumstances that are now legal and this is one way of achieving this.
“Information on these convictions is held on Police Scotland records and we have engaged with Police Scotland to seek views on steps that could be taken to right these historic wrongs.”
Kezia Dugdale, the Scottish Labour leader, said she is “beyond thrilled” the SNP Government had answered her calls for automatic pardons.
She said they must go further and issue a formal apology to those affected.
“Obviously the Scottish Government isn’t responsible for laws decades old, or prosecutions, convictions or sentences associated with them,” she said.
“But they could issue a formal apology without accepting liability.
“For many men, an apology is as important as a formal pardon – because an apology demonstrates that they should never have been branded a criminal in the first place.
“I am therefore also pleased the Scottish Government is seriously considering apologies alongside legislative pardons.”
John Nicolson, the SNP MP, sought to get automatic pardons for those convicted of same-sex offences through his private member’s bill at Westminster, which fell at the first hurdle.
It was has been referred to as “Turing’s law” in honour of the Cambridge professor Alan Turing, who helped crack German codes in the Second World War before being convicted of gross indecency in 1952.
The UK Government says it is putting forward its own system for posthumous pardons, adding it could not support Mr Nicolson’s blanket proposals because some people could be cleared of offences that are still crimes, such as child abuse.
Mr Matheson said the Scottish bill will include provisions to ensure that convictions relating to offences that are still illegal continue to stand.
Liberal Democrat MSP Alex Cole-Hamilton welcome the move by Scottish ministers.
“Men convicted under this old law did nothing wrong and it is absolutely right they are given a full pardon,” he said.
“This step will bring much needed closure to those men who had a great wrong committed against them.”