Renfrewshire North and West MSP Derek Mackay has resigned from the SNP after he was suspended by the party over messages he sent to a teenage boy.

In February last year, Mr Mackay quit as finance secretary hours before he was due to deliver the Scottish budget, following reports he sent hundreds of messages to a 16-year-old boy on social media.

It was reported that he had befriended the teenager on Facebook and Instagram and sent him 270 messages.

Mr Mackay was then suspended from the SNP, pending further investigation, but has continued to sit as an independent MSP.

He has now told the party he is resigning to "focus on the recovery of my mental health and serving my constituents."

A spokesman for the SNP said: "Derek Mackay has resigned his membership of the SNP, bringing the matter to a close.

"As was widely reported last year, Mr Mackay was receiving mental health support and, as a result, disciplinary action was paused.

"We wish him well for his recovery."

Mr Mackay wrote to the SNP National Secretary earlier this week to inform the party of his decision.

In the letter, he stated: "I write to confirm I am not seeking SNP membership and continue to focus on the recovery of my mental health and serving my constituents."

Announcing his resignation as a minister on budget day last year, Mr Mackay admitted he had "behaved foolishly" and apologised "unreservedly" to the individual involved and his family.

Police Scotland carried out an investigation into the messages Mr Mackay sent to the teenager and concluded no crime was committed.