The chairwoman of the Scottish government's child abuse inquiry, Susan O'Brien QC, has resigned after facing the sack over "unacceptable" comments.
Deputy First Minister John Swinney said he had accepted Ms O'Brien's resignation after starting the formal procedure to remove her from her post.
However, Ms O'Brien insisted she had "done nothing wrong", complaining of government interference in the probe.
Her fellow panellist Prof Michael Lamb quit the inquiry over similar concerns.
Ms O'Brien's resignation leaves the inquiry, which concerns historical allegations of child abuse in Scotland, with only one panel member. It is scheduled to last four years, but has been criticised by survivors of abuse.
In her resignation letter, the chairwoman said the government had "sought to micro-manage and control the inquiry", and had "undermined" her and threatened to sack her when she resisted.
Mr Swinney said Ms O'Brien had "revealed views" which child abuse trauma experts had judged to "indicate a belief system that is incompatible with the post of chair of such an inquiry".
Ms O'Brien did not contest that she made the comments, but maintained they were "acceptable in the context in which they were made".
Complaints were lodged due to two comments Ms O'Brien made during a training session for inquiry team members.
One concerned her recounting the experiences of a child sex abuse victim in a manner which was claimed "potentially breached confidentiality".
Child abuse expert Dr Claire Fyvie said that even if this was meant to "lighten the mood", it was "wholly inappropriate" and "demonstrates a shocking level of misjudgement".
Dr Fyvie is head of service at the Rivers Centre for Traumatic Stress, which was initially a short-term partner of the inquiry.
However, the centre did not submit a tender to support the inquiry long-term, with Dr Fyvie saying the role of an expert advisor was "redundant", as Ms O'Brien appeared to be making decisions "unilaterally", "with no regard to the advice of professional colleagues or external advisors".
In her resignation letter, Ms O'Brien insisted that she had "done nothing wrong", insisting that she would "never underestimate the gravity of child abuse".
With regards to the training event comment, she said she had "accurately reported, without endorsing, what a survivor had said to me about their attitude to their own abuse".
She said: "Since you have approached the dismissal of a chair so casually, on the basis of misunderstanding and inaccurate allegations about my 'attitudes and beliefs', I have no confidence that you would not try to dismiss me again another time, even if you decide against dismissal now.
"This compromises my ability to carry out my duty to ask questions and reach conclusions fearlessly.
"In short, I cannot reassure the public that this inquiry will be conduced independently of government. My trust that the Scottish government will actually respect the independence of the inquiry has gone - you have therefore left me with no alternative but to resign."
Education secretary Mr Swinney said the comments had "raised serious concerns", and "lacked any context in which they could be seen as acceptable".
He added: "What's more, these actions had the potential to cause the loss of confidence of survivors - the very people at the heart of the inquiry."
Mr Swinney has referred the matter to the Scottish Parliament's education and skills committee to be investigated.
The minister said: "Given the severity of those concerns, I felt I had a duty to initiate statutory proceedings which could have led to the removal of the chair from post. Ms O'Brien's resignation clearly now means that process has not been concluded and frees me to now share the facts of the case with parliament.
"I am happy for a committee of parliament to consider this matter and any claims made by the chair.
"This government absolutely rejects any charges of interference in the independence of the inquiry. The issues that concern the government are about having a robust independent inquiry that can operate without fear or favour, fulfilling our responsibilities set out in the Inquiries Act and ensuring that the chair's departure has as little impact as possible on the progress of the work needed."
Mr Swinney, who is to meet survivors on Thursday, said he would take "urgent steps" to appoint a new chair for the inquiry.
The two resignations leave the panel with just one member, Glenn Houston.
Scottish Conservative MSP Liz Smith said what was of "paramount importance" was to restore public trust and "to that end we welcome the announcement by Mr Swinney to permit parliamentary scrutiny of his actions".
Scottish Labour education spokesman Iain Gray said the "collapse of the inquiry into crisis" meant "we are letting survivors of child abuse down yet again".
He said: "When parliament returns the education committee must carry out an investigation into how this mess was allowed to develop."
Ross Greer, Scottish Green MSP, believed that there needed to be "urgent but careful progress" in appointing new members of the inquiry.
He said: "This issue has support from across the political spectrum and we owe it to survivors of abuse to make sure the inquiry is carried out."