THE Scottish Government tried to throw up hurdles to the Scottish Sun to prevent us publishing bombshell revelations about Derek Mackay.

Yesterday we exclusively revealed the former Finance Secretary, 42, bombarded a 16-year-old schoolboy with 270 texts in six months and called him "cute".

3 Mr Mackay pestered teen with hundreds of messages

3 Mr Mackay and First Minister Nicola Sturgeon

But the day before publication the Government demanded to know the name of the boy as well as asking for our “justification for publication, given the intrusion into private and family life, and correspondence including digital communication”.

They fired back a string of questions to The Scottish Sun — which could have potentially hampered publication of the story — following two 15-minute conversations with the First Minister’s spokesman at 5.50pm and 6.40pm.

In the conversations, we detailed the allegations, read out key exchanges and flagged up experts’ concerns.

Derek Mackay sent 270 texts to a 16-year-old boy

The former Finance Secretary quit after his messages were revealed in The Scottish Sun

We also advised the Government to speak to Mr Mackay to view the entire conversation.

But in an email at 7.23pm, the Scottish Government questioned the “justification” for the story.

It said: “Given you yourself state that there is nothing illegal or unlawful in the messages, can you advise on your justification for publication, given the intrusion into private and family life, and correspondence including digital communication.”

The First Minister’s main concern should be for this boy and his family, not a night of spin and her own PR requirements. Jackson Carlaw

The Government also asked for written confirmation “that the material has been obtained by legitimate means”, and “the material you are basing this story on to be emailed across to us as soon as possible”.

The Government then insisted our newspaper had a “moral obligation to share this material in order for us to be in a position to offer any form of substantive response or view”.

The email also added: “Can you advise on the name of the individual?”

The Scottish Sun declined to provide the information and the Scottish Government later refused to comment.

The First Minister came under fire over the government response to the scandal of her key lieutenant sending unwanted messages to a schoolboy.

It emerged ex-Finance Secretary Mackay was allowed to resign — rather than be fired — following a meeting with Ms Sturgeon in his parly office on Wednesday night.

Scottish Tory interim leader Jackson Carlaw, said: “The information she received would have been clear — and he should have been sacked on the spot. 3

He added: “The First Minister’s main concern should be for this boy and his family, not a night of spin and her own PR requirements.”

And the Scottish Lib Dems also slammed Ms Sturgeon over her response.

A party spokesman said: “Once the First Minister was aware of troubling and alarming events she should have immediately acted to remove Derek Mackay from his position.”

Mackay’s dramatic meeting with Ms Sturgeon came after The Scottish Sun shared details of his disturbing messages to the 16-year-old boy with the First Minister’s official spokesman, at 5.50pm on Wednesday night.

The Government later refused to comment and it was not until 8.09am on Thursday that a carefully worded statement was released from Mackay and Ms Sturgeon — saying he had resigned for acting “foolishly”.

Quizzed on why he was not sacked, the First Minister’s spokesman told a Holyrood media briefing that Mackay offered to resign “pretty much immediately” after Ms Sturgeon found out.

Asked why his departure was only announced the following day, he said: “We took the decision to allow Derek to speak to the people close to him and to announce this first thing in the morning.”

Jackson Carlaw quotes NSPCC definition of grooming after Derek Mackay's text scandal with boy, 16

The spokesman also said “the detail” of the six months of Mackay’s messages to the boy only emerged at 11pm — when the Scottish Sun published the story.

Quizzed by reporters, Ms Sturgeon suggested Mackay jumped before he was pushed.

She said: “He offered his resignation but regardless of that it would have not been an option in my view for him to remain in government from what I knew last night.”

MORE FROM THE DEREK MACKAY TEXT SCANDAL Exclusive MACKAY'S LAW Tory MSP launches bid for new law to kick out AWOL politicians like Mackay Exclusive NO-SHOW Mum of Derek Mackay text scandal teen calls for Holyrood to force MSPs to turn up OFF THE A-GENDER Shamed MacKay to be ousted from seat as SNP line-up all-female shortlist Exclusive NOT ON SNP 'broke own rules' in delaying shamed Mackay’s disciplinary hearing, says ex-Nat 'FRONT UP OR RESIGN' Derek Mackay accused of using job losses to 'rehabilitate his image' NAT SCANDAL Rise and fall of ex-Finance Secretary Derek Mackay amid schoolboy text scandal

Pressed on why she didn’t sack Mackay rather than let him resign, the First Minister gave no answer before dodging more questions by walking into a lift that was being held for her.

Her spokesman was also quizzed on whether the use of the word “foolish” in the statement announcing Mackay’s resignation downplayed the gravity of the message blitz.

He replied: “Those are Derek’s words. That’s clearly how Derek Mackay himself regards what happened.”

chris.musson@the-sun.co.uk

Nicola Sturgeon says Derek Mackay's conduct is 'unacceptable' as he is suspended from SNP

We pay for your stories and videos! Do you have a story or video for The Scottish Sun? Email us at scoop@thesun.co.uk or call 0141 420 5300