Image copyright Getty Images Image caption Consensual sex between men over the age of 21 was made legal in Scotland in 1980 - 13 years after England and Wales

Gay and bisexual men convicted under discriminatory laws which have now been abolished are to receive an automatic pardon from Tuesday.

Same-sex activity between men was illegal in Scotland until laws banning homosexual relations were repealed in 1980.

But the convictions of those convicted of offences before then were retained on official records.

They can now apply to have them removed under a "disregards" scheme.

The Historical Sexual Offences (Pardons and Disregards) (Scotland) Act followed an unqualified apology by the first minister to those convicted of same-sex sexual activity that is now legal.

'Hurt and harm'

Addressing Holyrood in November 2017, Nicola Sturgeon said: "Today, categorically and wholeheartedly, as first minister I apologise for those laws, and for the hurt and the harm that they caused.

"Nothing this parliament does can erase those injustices. But I hope that this apology, alongside our new legislation, can provide some comfort to those who endured them."

The legislation grants an automatic pardon to every gay and bisexual man in Scotland convicted under discriminatory laws, which were repealed almost 40 years ago. The age of consent was equalised in 2001.

Criminal records can also be altered to remove any mention of convictions for same-sex offences which are no longer on the statute book.

Any man with such a conviction can now apply to have it "disregarded" so it will never show up on, for example, an enhanced disclosure check. It expects about 25 men to do so over the next five years.

Image copyright Getty Images Image caption Offences which could have led to a conviction until 1980 including kissing another man in public

The Scottish government said it had been working closely with Police Scotland and other partners to ensure the "disregard" scheme was clear and effective and had appropriate safeguards in place.

But the scheme will not apply to behaviour that is still illegal today - for example rape or having sex with someone under the age of 16.

Any man wishing to apply for a "disregard" can apply on line.

Before the law changed, men could be prosecuted for offences including consensual sexual activity in private, kissing another man in a public place, or just chatting up another man in a public place - which was known as "importuning".

Such behaviour was legal at the time between a man and a woman, and is legal today between two men.

Landmark legislation

The director of the Equality Network, Tim Hopkins said: "Centuries ago, the death penalty applied in Scotland to sexual relationships between men.

"More recently, during the 20th Century, hundreds of men in Scotland were sent to prison for consensual adult relationships - and we know of men who as recently as the 1990s were convicted of a criminal offence and fined, for no more than kissing another man in public.

"Today's pardon applies to all those cases. Nothing can undo the harm of centuries of homophobic discrimination, but at least the state now acknowledges that it was the law that was wrong, and the people convicted under it did nothing wrong."

Justice Secretary Humza Yousaf said: "There is no place for homophobia, ignorance and hatred in modern Scotland.

"This landmark legislation provides an automatic pardon to men convicted of same-sex sexual activity, which is now entirely legal."

Sophie Bridger, campaigns, policy and research manager for Stonewall Scotland, said: "Along with the hurt and damage that came with being prosecuted for who they loved, some people have been carrying a criminal record for something which should never have been illegal.

"They will now finally have the chance to delete these former offences from their criminal record.

"We hope this will bring comfort and closure to those affected and draw a line once and for all under this dark piece of Scotland's history."

Turing law

In England and Wales, where homosexual acts between consenting adults was permitted after 1967, there is similar legislation - dubbed the "Turing law" after the World War Two code-breaker Alan Turing who was pardoned posthumously in 2013 for his conviction of gross indecency.

Gay and bisexual men convicted of now-abolished sexual offences in England and Wales have received posthumous pardons, and those still living can apply for one.

But campaigners said fewer than 200 men had so far received a pardon under the new law.

Thousands of gay men are unable to obtain pardons because the offence they were convicted of - importuning - is not one of those eligible, despite the government acknowledging it was used in a discriminatory way.

Campaigners have said others are put off from even applying by an intimidating, bureaucratic system.