A Scottish government minister has resigned over previous actions which he said were considered "inappropriate".
Mark McDonald, the SNP MSP for Aberdeen Donside, said he was stepping down from his role as childcare and early years minister.
He apologised and said his attempts to be "humourous" or "friendly" may have led others to become uncomfortable.
He is one of two SNP members currently being investigated by the party over possible misconduct.
It is understood the allegations against him are not criminal in nature. The other complaint being investigated by the SNP does not relate to a parliamentarian.
In a statement he said: "It has been brought to my attention that some of my previous actions have been considered to be inappropriate - where I have believed myself to have been merely humorous or attempting to be friendly, my behaviour might have made others uncomfortable or led them to question my intentions.
"My behaviour is entirely my responsibility and I apologise unreservedly to anyone I have upset or who might have found my behaviour inappropriate.
"In light of my position in government, I believe it would not be appropriate for me to continue to serve in my role in the Scottish government at this time and I have tendered my resignation as a minister.
"I hope that in taking this step neither any particular woman or my family will be the focus of undue and unwarranted scrutiny.
"It has been an honour to serve in the Scottish government and I will continue to serve my constituents in Aberdeen Donside to the best of my ability."
A former Aberdeen City councillor, Mark McDonald was elected as a list MSP at Holyrood in 2011 and became a constituency MSP when he won the Aberdeen Donside by-election in 2013, following the death of Brian Adam.
The 37-year-old was responsible for a members bill on high hedge disputes, which passed unanimously at Holyrood. He was appointed a minister in May 2016.
Earlier this week First Minister Nicola Sturgeon and Deputy First Minister John Swinney both warned men - including those in the SNP - to reflect on their behaviour as allegations of sexual harassment reached Holyrood.
A spokesperson for the first minister said: "Mark has taken the right action in apologising and recognising that in his current role it would be inappropriate for him to remain in government.
"He will continue to make a valuable contribution to parliament as the MSP for Aberdeen Donside.
"As the deputy first minister told parliament earlier in the week it is right that men take responsibility for their behaviour and it is to Mark's credit that he has done so."
Confidential phone line
A confidential phone line has been launched and an anonymised survey is to be carried out to determine the extent of sexual harassment at the Scottish Parliament.
The measure was announced after Presiding Officer Ken Macintosh held an urgent meeting with representatives from each party including Nicola Sturgeon.
A Scottish government spokesperson said Mr McDonald tendered his resignation to the first minister on Saturday.
"The education secretary is responsible for all aspects of the education portfolio including those led by the minister for childcare and early years. The first minister will appoint a new minister in due course," the spokesperson added.