The Historical Sexual Offences (Pardons and Disregards) Bill passed by 119 votes to zero and will automatically pardon gay men convicted under historical discriminatory laws. It will also allow them to apply for past convictions of this nature to be legally disregarded or removed from criminal records.
Private same-sex activity between two men aged over 21 was not legalised in Scotland until 1981 and the age of consent for gay men was reduced to 16 only in 2001.
The last anti-gay references remained on the criminal statute book in Scotland until late 2013.
Police Scotland have identified up to 1,261 offences recorded against 994 people which fall within the scope of the Bill.
MSPs have heard evidence from a man who was convicted in the early 1990s of kissing a man in the street who said his career had been hindered as he feared applying for jobs which required a disclosure check.
Earlier, Justice Secretary Michael Matheson said the new law means people will no longer face discrimination for “unjust” convictions.
He said: “I am under no illusion that this Bill, or any legislation, can in itself right the massive injustice caused by these discriminatory laws that criminalised the act of loving another adult, deterred people from being open about who they are to family, friends, neighbours and work colleagues, and, by sending a message that Parliament considered that homosexuality was wrong, encouraged homophobia and hatred.
“However, through the pardon, the Bill sends a clear message to those who were affected by these laws that they were unjust and, through the establishment of a disregard scheme, we can ensure that people do not continue to suffer discrimination as a result of such convictions being disclosed to potential employers or to organisations for whom they wish to undertake voluntary work.”
The legislation has cross-party backing and is expected to pass its final vote following a stage three debate.
About 49,000 gay and bisexual men convicted of now-abolished sexual offences in England, Wales and Northern Ireland received posthumous pardons in January last year.