UK legislation will be amended following a deal between the Liberal Democrats and Conservatives at Westminster, giving a blanket pardon to men convicted before homosexuality was decriminalised in England and Wales in 1967 who are deceased.
Those still living will be able to apply to have their cases examined by police before a possible pardon.
However, a bid by SNP MP John Nicolson to have the pardon applied automatically to both living and dead gay men failed yesterday after a Government filibuster.
Mr Nicolson’s private member’s bill was backed by gay equality charity Stonewall, which has also called on the UK Government to issue apologies to gay men given criminal records.
Lib Dem MSP Alex Cole-Hamilton said: “These men did nothing wrong. It is absolutely right that their convictions under these outdated and discriminatory laws are pardoned. With the Policing and Crime Bill largely applying to England and Wales we need to ensure that men in Scotland can benefit from this change too.
“The Scottish Government needs to explore all options to ensure that this happens as a matter of urgency. I am sure they will have the support of the whole parliament if they do so.”
Campaigns for gay men to be cleared of historic convictions intensified in 2013, when a royal pardon was issued to Alan Turing, the Second World War code breaker.
Mr Turing was convicted of gross indecency in 1952 for a relationship with a 19-year-old man and forced to undergo chemical castration.
He died of cyanide poisoning in 1954 in a suspected suicide.
Scottish Labour leader Kezia Dugdale said: “Such steps have been a long time coming. Alan Turing is a British hero who deserves to be remembered for what he did for our country, not remembered because of his sexuality.
“The same is true for the countless other men who contributed to our society, and I hope the new measures will bring comfort to many families.
“I urge the Scottish Government to explore every option to ensure that men in Scotland can receive pardons.”
Homosexuality was only decriminalised in Scotland in 1980, and the age of consent was equalised for homosexuals in 2001.