Scotland is issuing pardons for men convicted under former laws that criminalized same-sex sexual activity and flirting. The automatic pardons took effect Tuesday under a new law, which was passed unanimously by parliament last year, reflecting the fact that such actions are no longer illegal.

Hundreds of men in Scotland were living with criminal records from those past convictions, according to Equality Network, which said the convictions had interfered with the professional and personal lives of those targeted by the discriminatory laws, the Thomson Reuters Foundation reports. In all, thousands are believed to have been prosecuted for consensual same-sex contact over the last 150 years.

“We know of people who were prosecuted as late as the early 1990s for things like kissing their boyfriend in the street,” said director Tim Hopkins.

“A conviction like this could have meant the end of your career, it could have meant losing your friends, it could have meant losing your family, all of those huge impacts. The pardons and the disregard can’t undo all of the harm done by these discriminatory laws but they do at least give some comfort to people.”

First Minister Nicola Sturgeon has apologized for the “historic wrong” but the country stopped short of offering compensation, with then-justice secretary Michael Matheson arguing it would be unfair to those targeted by other homophobic laws from that era. Those wishing to have their records wiped clean must apply through a free process, which is required because the offenses are wide-ranging and therefore it was not possible for authorities to identify them.

England and Wales have also enacted laws to pardon men convicted under such laws, although those only offered automatic pardons to those individuals who were no longer living.