Scotland's finance minister resigned Thursday after revelations he had reportedly sent hundreds of messages to a 16-year-old boy on social media.
Derek Mackay, who was due to deliver his annual budget on Thursday, said he had "behaved foolishly and I am truly sorry."
"I apologize unreservedly to the individual involved and his family," MacKay said in a statement.
"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 42-year-old 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.