Nicola Sturgeon is to formally apologise to gay men convicted of sexual offences that are no longer illegal.
The first minister’s statement will coincide with new legislation that will automatically pardon gay and bisexual men convicted under historical laws.
It will also allow the removal of such convictions from criminal records.
Consensual homosexual acts between men aged over 21 in Scotland were only decriminalised in 1981.
And it was not until 20 years later that the age of consent for gay men was lowered to 16.
Ms Sturgeon will apologise on behalf of the Scottish government to all of those convicted before 2001 under discriminatory laws against same-sex sexual activity that is now legal.
The apology will be made on the same day as the publication of the Historical Sexual Offences (Pardons and Disregards) Bill.
The legislation will give an automatic pardon to gay men convicted under historical discriminatory laws – but will not apply to behaviour that is still illegal today.
It will also enable men to apply to have convictions for same-sex sexual activity that is now legal removed from central criminal conviction records.
Justice Secretary Michael Matheson said the new legislation was an important step towards addressing the injustice faced by many gay men in the past.
He added: “These discriminatory laws, although abolished, continue to have implications for people to this day and it is only right that we address this historic wrong, which criminalised people simply because of who they loved.”
What will the legislation actually do?
The bill would give an automatic formal pardon to people, both living and dead, who were convicted of historical sexual offences where the conviction was for conduct which is now legal.
However, the pardon is a purely symbolic acknowledgement that the laws were discriminatory, and it does not reverse the conviction.
Anyone with a historical conviction for same-sex sexual activity that is now legal would have to apply for a formal “disregard” in order to prevent the information being included in disclosure checks.
It would then be up to Scottish ministers to decide, based on the available evidence about the specific case, whether the disregard is granted.
A successful disregard application means the conviction will not appear on any background check carried out by Disclosure Scotland, and the person will be treated as not having committed the offence.
Derek Ogg, a QC who has campaigned for gay rights for decades, told the BBC’s Good Morning Scotland programme that it was a “wonderful day”.
He added: “It’s Scotland at peace with itself and it is a reconciliation between the people in Scotland who are alive and the families of gay people who are dead, who were prosecuted, convicted, simply because of the gender of the person they loved or fancied.
“You can’t underestimate the scars that leaves on people. I’ve never been convicted of such an offence but the fact is that the law was there and could have been used, I could have been arrested.
“I was at the very beginning of my legal career – my career would have been destroyed. An apology, together with the pardons bill, is appropriate.”
His views were echoed by former Scottish Labour leader Kezia Dugdale, who praised Ms Sturgeon for making the apology.
She said: “The reality is Nicola Sturgeon is going to apologise on behalf of previous governments, other governments, and that takes a very big heart to do.
“It’s very welcome as it’s only when we are at peace with our past can we really focus on ensuring that, for the future, Scotland is an open and welcome place for LGBT people.”
Gay and bisexual men convicted of now-abolished sexual offences in England and Wales received posthumous pardons in January, with thousands of living men convicted over consensual same-sex relationships also eligible for the pardon.
It followed the pardoning of World War Two code-breaker Alan Turing for gross indecency in 2013.
Private homosexual acts between men aged over 21 were decriminalised in England and Wales in 1967.