Derek Mackay has resigned as the Scottish finance secretary with immediate effect following allegations he sent inappropriate messages to a teenage boy.

It comes just hours before he was due to reveal the country's budget.

The minister is alleged of sending hundreds of texts to a 16-year-old, including calling him "cute".

The 42-year-old was accused of “targeting” the teenager and reportedly contacted him on Christmas Day despite knowing the boy’s age.

In a statement, Mr Mackay said: "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."

READ MORE: Scottish finance chief Derek Mackay accused of sending 'inappropriate' messages to teenage boy

Mr Mackay was due to deliver the Government’s £43 billion spending plans at Holyrood.

Instead, Kate Forbes - Minister for Public Finance - will present the budget.

The Scottish Sun reported the interactions began last August when Mr Mackay contacted the teenager out of the blue.

He is said to have asked “Are our chats between us?” before telling the teen: “I think you are really cute.”

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.”

Speaking at First Minister's Questions, Nicola Sturgeon confirmed that Mr Mackay has been suspended from the SNP and parliamentary group with an investigation to come. 

Ms Sturgeon says Mr Mackay has apologised unreservedly for his conduct and recognised it is unacceptable.

The First Minister said she "does not condone his conduct in any way, shape or form."