Men with historical prosecutions for same-sex sexual activity will be able to apply to have their convictions erased from October.
Last year, MSPs passed legislation unanimously to grant an automatic pardon to every man in Scotland criminalised for breaching now repealed discriminatory laws.
Men will be able to apply to have their convictions wiped when the new legislation comes into force on October 15.
It means convictions will be removed from central criminal records by being disregarded.
Same-sex sexual activity between men was made legal in Scotland in 1980, while the age of consent was equalised in 2001.
In November 2017, First Minister Nicola Sturgeon issued unqualified apologies to men convicted of same-sex sexual activity that is now legal.
Justice Secretary Humza Yousaf said: “We have been working with Police Scotland and other partners to ensure we have a clear and effective system in place as we bring this important legislation into force.
“Subject to Parliament approving the necessary secondary legislation, in October the Act will enable people convicted of these offences to apply to have them disregarded so they will never show up on any form of disclosure or criminal records check.
“And it will provide an automatic pardon to all men convicted of same-sex sexual activity that is quite rightly now legal.
“There are people in Scotland who were criminalised simply because of who they love under laws which fostered homophobia, ignorance and hatred.
“The Scottish Government absolutely understands the distress that this has caused and we have worked across the Parliament to address this historical injustice.”
Equality Network director Tim Hopkins said: “We welcome the news that the Act will come into force on October 15.
“On that date, everyone who was convicted for one of the discriminatory offences that targeted relationships between men will receive an automatic pardon.
“Shamefully, those convictions were for things that were legal between a woman and a man, in some cases no more than a kiss in a public place.
“The damage done by Scotland’s homophobic past can never be undone but the wrong has now been recognised and acknowledged.
“Those who have such convictions on their record will also be able to apply to have them removed and that will go some way to relieve a burden and stigma that they have carried for decades.”