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.”
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.