Scotland will introduce its own pardons law for historical gay sex offences, the government has announced.

Last week the UK government announced the fulfilment of a 2015 Conservative Party manifesto pledge, by accepting a Lib Dem amendment to a Policing bill that will see men previously convicted for consensual same-sex relationships formally pardoned.

On Friday, UK Justice Minister Sam Gyimah infuriated the Scottish National Party by scuppering a rival plan submitted by MP John Nicolson, which would see a more broader ‘blanket pardon’ issued without requiring .

However, the Scottish government has today announced it would pursue its own devolved legislation on the issue.

The news came in response to a question from the leader of the Scottish Labour Party, Kezia Dugdale.

Ms Dugdale had asked the Scottish Government “whether it will quash the convictions and cautions issued to people for now-abolished gay sexual offences and issue pardons.”

Scottish Justice Minister Michael Matheson MSP confirmed he would be bringing about its own law to allow men with historic gay sex offences to receive pardons.

He also confirmed he was separately working in partnership with Police Scotland to “determine the practical steps required” to allow men to have their convictions disregarded. Scotland kept sodomy laws until 1980, 13 years longer than England and Wales.

Mr Matheson said: “It is sadly the case that Scotland has only relatively recently modernised our criminal laws so that they no longer discriminate against same-sex sexual activity.

“It is shocking to consider that consensual sex between men was only decriminalised in Scotland in 1980 and the age of consent for same-sex sexual activity was not equalised for sexual activity between men and women until 2001.

“Such laws clearly have no place in a modern and inclusive Scotland. However, there are people with criminal convictions for same-sex sexual activity that is now lawful and we must right this wrong.

“We will introduce an automatic formal pardon for those convicted under these discriminatory laws so they know they are absolved fully. We want to address the injustice that people experienced simply because of their sexual orientation in circumstances that are now legal and this is one way of achieving this.

“Information on these convictions is held on Police Scotland records and we have engaged with Police Scotland to seek views on steps that could be taken to right these historic wrongs.

“I have instructed my officials, working in partnership with Police Scotland, to determine the practical steps required to establish a scheme to allow men convicted for actions that are now legal to seek to have those convictions disregarded.

“Where an offence is disregarded a person will be treated as not having been convicted of that offence and so it would not appear on, for example, disclosure checks.

“I know Parliament will want to work together to resolve these important issues.”

Ms Dugdale, who came out earlier this year, hailed the announcement as a “historic moment” in the country, urging First Minister Nicola Sturgeon to issue a formal apology on behalf of the country for the laws.