Gay men convicted of now-abolished crimes are set to receive an apology from the Scottish government.
First minister Nicola Sturgeon will issue a formal apology at Holyrood on November 7 to coincide with new legislation that will provide an automatic pardon to men convicted under the country's historic anti-gay laws.
The new bill, first promised by the SNP leader last September, will enable people to apply to have such convictions removed from central criminal conviction records.
A Scottish government spokesperson said: "The First Minister will give a statement of apology to those convicted prior to 2001 under discriminatory laws against same-sex sexual activity that is now legal.
He added: "The apology will be made on behalf of the Scottish government for the treatment of homosexual men under previous governments and will coincide with the introduction of legislation to provide people convicted under these laws an automatic pardon.
"The bill will right a historic wrong and give justice to those who found themselves unjustly criminalised simply because of who they loved."
Tim Hopkins, director of the Equality Network, said: "The apology is important because it shows that it was the discriminatory laws that were wrong, and not the consensual relationships that were made criminal by those laws.
"We look forward to seeing the detail of the bill. If it implements the policy announced by the Scottish Government, it will be a hugely important statement that Scotland regrets the discrimination of the past, and now considers its LGBTI people to be fully equal citizens who deserve equal respect.
"It will also be of direct practical importance to people who currently have one of these convictions show up on criminal record checks for jobs or volunteer posts."
Review | Does Call Me By Your Name live up to the hype?
Men who have oral sex with multiple partners at risk of throat cancer, doctors say