Derek Mackay has issued a statement after resigning this morning.
Scotland’s finance secretary handed in his notice after claims he sent inappropriate texts to a 16-year-old schoolboy.
The drama came just hours before Mr Mackay was due to outline the government’s £43 billion Budget plans to MSPs at Holyrood today.
He said in a statement: “I take full responsibility for my actions. I have behaved foolishly and I am truly sorry.
“I apologise unreservedly to the individual involved and his family.
“I spoke last night with the First Minister and tendered my resignation with immediate effect.
“Serving in government has been a huge privilege and I am sorry to have let colleagues and supporters down.”
Accepting Mr Mackay’s resignation, First Minister Nicola Sturgeon said: “Derek has taken full responsibility for his actions and apologises unreservedly for them to the individual involved and to those he has let down.
“He has submitted his resignation as a government minister which I have accepted.
“Derek has made a significant contribution to government, however he recognises that his behaviour has failed to meet the standards required.
“The Minister for Public Finance, Kate Forbes, will present today’s Scottish Government budget setting out our actions to support the economy, back our people and public services and tackle the climate crisis, and that remains my government’s focus.”
The Scottish Sun reported Mr Mackay sent 270 private messages to the boy on Instagram and Facebook over six months after contacting him out of the blue.
In one message he is alleged to have told the boy he thought he was “cute”.
Junior minister Kate Forbes will now step in to deliver the Scottish budget this afternoon.
Mr Mackay had been tipped as a potential successor to Mrs Sturgeon.
Follow all of the news from Holyrood as it happens: