A law passed Wednesday with a unanimous vote of the Scottish Parliament will formally pardon gay and bisexual men convicted under antigay laws that are no longer in place.

The law, Historical Sexual Offences (Pardons and Disregards), will give an automatic (and symbolic) pardon to men convicted under previous antigay laws and allow them to apply to Scottish government inisters for a removal, or “disregard,” from official records.

Police Service of Scotland found that over a thousand offenses recorded against 994 people would be eligible for pardon, according to The Scotsman.

If the government accept sthe application for disregard, the conviction will not show up in background checks carried out by Disclosure Scotland, reports the BBC.

Prior to the vote, Justice Secretary Michael Matheson said the bill sends the message that historic antigay statutes were unjust. “I am under no illusion that this bill or any legislation,can in itself right the massive injustice caused by these discriminatory laws that criminalized 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,” he said.

Sexual activity between men was illegal in Scotland until 1980, when Section 80 of the Criminal Justice (Scotland) Act of 1980 legalized such activity for men over the age of 21. In 2001, the age of consent for sex between men was lowered to 16, the same age of consent applied to heterosexual couples.

Scotland removed its last antigay statutes from the books when it established marriage equality with the Marriage and Civil Partnership (Scotland) Act of 2014.

When the bill was initially proposed last November, Nicola Sturgeon, first minister of Scotland and leader of Scottish National Party, made a public apology to men convicted under the now repealed antigay laws.

"As first minister I categorically, unequivocally, and wholeheartedly apologise for those laws and for the hurt and the harm that they caused to so many," Sturgeon said. "Nothing that this Parliament does can erase those injustices, but I do hope this apology, alongside our new legislation, can provide some comfort to those who endured those injustices. … And I hope that it provides evidence of this Parliament's determination insofar as we can to address the harm that was done."

Though the vote was unanimous, Member of Parliament and SNP member John Mason said in a private email to a constituent that he did not believe in retroactive pardons such as those implemented in the new law, according to The Scotsman.

Mason said that members of particularly religious communities believe "it is wrong for one person of the same sex to have a sexual relationship with someone else" and that "some people believe that it is only within marriage that people should have sexual relationships."

Tim Hopkins, director of Equality Network, said the first minister’s apology and the unanimous passage of the bill jointly sent a message that antigay discrimination is no longer acceptable in Scotland, but that there is still more work to be done, according to a Scottish government news service.

"LGBTI people continue to face prejudice and hostility," Hopkins said, adding, "We look forward to continuing to work with the Scottish Government, on the forthcoming reform of the Gender Recognition Act, and other work to address homophobia, biphobia, and transphobia, and to promote fairness for all."