Former finance secretary Derek Mackay has been suspended from the SNP following reports he sent hundreds of messages to a 16-year-old boy, Nicola Sturgeon has confirmed at First Minister's Questions.
She faced calls to investigate his "predatory" behaviour after Mr Mackay stepped down from his Cabinet post on Thursday.
Ms Sturgeon said his conduct "falls seriously below the standard required of a minister" and he had been suspended from both the party and the SNP parliamentary group at Holyrood "pending further investigation".
The father-of-two, who came out as gay in 2013, quit as finance secretary after The Scottish Sun reported he sent 270 messages to a boy he befriended on Facebook and Instagram.
News of his resignation came hours before he was due to deliver the budget for the coming year – with Public Finance Minister Kate Forbes now stepping in to make the tax and spending announcements.
Speaking at Holyrood, Ms Sturgeon said: "Members will be aware that I have accepted the resignation of Derek Mackay as Finance Secretary.
"Derek Mackay has apologised unreservedly for his conduct and recognised, as I do, that it was unacceptable and falls seriously below the standard required of a minister.
"I can also advise that this morning he has been suspended from both the the SNP and our parliamentary group pending further investigation."
Mr Mackay accepted he had "behaved foolishly" as he apologised unreservedly to the youngster and his family.
In one message, he is alleged to have asked the teenager: "And our chats are between us?"
When the boy agreed, Mr Mackay told him: "Cool, then to be honest I think you are really cute."
The newspaper alleges he contacted the teenager over a six-month period and offered to take him to a rugby game and out to dinner.
Scottish Conservative interim leader Jackson Carlaw told ITV Border: "If these allegations are founded, and they are very detailed, very explicit, totally inappropriate and by any standard judgment of what constitutes the grooming of a young individual these would pass that test."
He added: "It's a huge lapse of judgment and a serious blow for the reputation of Parliament, as well as for Mr Mackay and the Scottish Government."
Scottish Liberal Democrat leader Willie Rennie said Mr Mackay should now step down as the MSP for Renfrewshire North and West.
He told ITV Border: "It is really about the standards that we would expect from MSPs at this time and I think Derek Mackay has not behaved in the standard that we would expect from a member of the Scottish Parliament.
"I think it would be time for him to resign now."
Meanwhile, Scottish Labour leader Richard Leonard said: "Derek Mackay has acted beyond 'foolishly' – his actions are predatory and must be thoroughly investigated.
"He has abused his position of power with a vulnerable adolescent.
"The nature and the gravity of these allegations demands decisive action."
In November 2017, the SNP suspended Mark McDonald after he resigned as childcare minister over "inappropriate" behaviour said to have involved text messages.
After the story broke Mr Mackay announced he had quit as Finance Secretary with immediate effect.
He stated: "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."
He added: "Serving in Government has been a huge privilege and I am sorry to have let colleagues and supporters down."
— Murdo Fraser (@murdo_fraser) February 6, 2020
Tory finance spokesman Murdo Fraser said Mr Mackay's resignation would be a "huge blow" for the First Minister.
Scottish Green co-leader Patrick Harvie said his resignation had been "clearly necessary" following "utterly unacceptable" behaviour.
But he added: "We are now just hours from publication of the Scottish budget in what were already unprecedented circumstances.
"It's vital now that all parties put the public interest first.
"Kate Forbes now has one brief opportunity to build political agreement over this month and amend the budget if necessary."
Mary Glasgow, chief executive of the children's charity Children 1st, said: "By resigning Derek Mackay has acknowledged that his behaviour was inappropriate.
"Children 1st has always been clear that children and young people are vulnerable in situations where there is a significant difference in age, power and status between them and another person.
"Society should recognise by now that it is never acceptable to exploit that vulnerability."