Gay men prosecuted under outdated laws will receive automatic pardons as new legislation comes into force in Scotland.

Men who were convicted for engaging in sexual acts with another man during a "dark piece of Scotland's history" can from Tuesday apply to have have their criminal records scratched from the official records.

The Historical Sexual Offences (Pardons and Disregards) Act - passed unanimously by the Scottish Parliament in June 2018 - is now in force

This means people criminalised for bisexual or homosexual relationships that are now legal will be pardoned.

Those who have historic convictions can apply to have it 'disregarded' from October 15, which means they will never show up on enhanced disclosure checks.

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

"We have been working closely with Police Scotland and other partners to ensure the 'disregard' scheme is clear and effective and has appropriate safeguards in place.

"This legislation makes good on the commitments made by the First Minister, who gave an unqualified apology for the now outdated and discriminatory laws, and for the harm they caused to many."

Sexual activity between men was made legal in Scotland in 1980 and the age of consent was equalised with heterosexual relationships in 2001.

Tim Hopkins, director of the Equality Network, said: "This is a historic day for Scotland.

"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."

Sophie Bridger, campaigns, policy and research manager for Stonewall Scotland, said: "The new disregards process is a positive step in righting historical wrongs that punished people in same-sex relationships.

"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."