Scotland's finance minister resigned yesterday hours before he was due to deliver his annual budget, after he reportedly sent hundreds of messages to a 16-year-old boy on social media.
Derek Mackay said in a statement he had "behaved foolishly and I am truly sorry".
"I apologise unreservedly to the individual involved and his family," he said. "Serving in government has been a huge privilege and I am sorry to have let colleagues and supporters down."
The 'Scottish Sun' newspaper reported that Mr Mackay sent the teen more than 270 messages on Facebook and Instagram, telling the boy he was "cute" and offering to take him to a rugby match and to dinner.
Mr Mackay (42) is not accused of breaking the law. But Scottish Labour Party leader Richard Leonard said his behaviour had been "nothing short of predatory" and "an abuse of power".
First Minister Nicola Sturgeon said Mr Mackay had been suspended from the Scottish National Party.