The chairwoman of the Scottish Child Abuse Inquiry has resigned from her post after claims she made comments which were "offensive to survivors".

Deputy First Minister John Swinney announced on Monday that he had accepted Susan O'Brien QC's resignation.

The move comes just a week after psychology professor Michael Lamb resigned from the investigation panel, claiming the Scottish Government had been interfering in the process.

Mr Swinney said he had started formal proceedings against Ms O'Brien after she allegedly made comments which were "incompatible with the post of chair of such an inquiry".

An expert in child abuse trauma, who was present when Ms O'Brien made the alleged comments, said they "lacked any context in which they could be viewed as acceptable".

The expert had been providing critical professional psychological support, including to survivors giving evidence.

Ms O'Brien's alleged comments prompted Mr Swinney to initiate a process laid down in statute which could have led to her removal.

The Scottish Government said in a statement that Ms O'Brien did not dispute the comments but she maintained they were acceptable in the context in which they were made.

She said in her letter of resignation, however, that officials had "actively undermined" her position.

Ms O'Brien also claimed that the expert who described her "offensive" comments had misunderstood what she knew about the case.

Mr Swinney, who has written to the parliament's education and skills committee with the details of the case, will meet survivors on Thursday.

He said he would take urgent steps to appoint a new inquiry chair.

Glenn Houston remains a member of the inquiry panel and steps are being taken to fill the chair and panel posts left vacant by Ms O'Brien and Mr Lamb.

Mr Swinney said: "Sadly, the comments of the chair raised serious concerns.

"The comments made were considered by a leading abuse trauma expert to be totally unacceptable and to indicate a belief system that is incompatible with the post of chair of such an inquiry; to be offensive to survivors and to lack any context in which they could be seen as acceptable.

"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.

"Given the severity of those concerns, I felt I had a duty to initiate statutory proceedings which could have led to 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."

In her resignation letter, Ms O'Brien defended herself and said the government had approached the dismissal of a chair "so casually, on the basis of misunderstandings and inaccurate allegations".

She added: "I cannot reassure the public that this inquiry will be conducted independently of government.

"My trust that the Scottish Government will actually respect the independence of the inquiry has gone.

"You have therefore left me within no alternative but to resign. I do so with a heavy heart, as I am clear that there is a real need for this Inquiry to take place."

Mr Swinney said the government "absolutely rejects" any charges of interference in the independence of the inquiry, adding: "We are confident that the inquiry staff will continue to deliver the highest quality of work and the Scottish Government will always remain focused on supporting them as they work on behalf of abuse survivors."

The Scottish Child Abuse Inquiry, set up to focus on allegations of abuse in formal institutional care settings, is expected to last four years.

Campaigners representing victims of childhood abuse have been critical of its remit, claiming it should have been widened to include abuse at religious organisations and children's groups.

They have also called for clearer information about support for survivors.

Opposition parties urged ministers to rebuild confidence following the latest blow to the inquiry.

Scottish Conservative shadow secretary for education Liz Smith said: "It was very clear that neither the victims nor the public at large could, in these circumstances, continue to have confidence in her chairmanship of the enquiry.

"Of paramount importance is restoring public trust and to that end we welcome the announcement by John Swinney to permit parliamentary scrutiny of his actions."

Scottish Labour Education spokesperson Iain Gray described survivors' confidence in the inquiry as "fragile", adding: "The deputy first minister needs to revisit these concerns now. Simply replacing Ms O' Brien and Professor Lamb will not be enough to restore confidence."

Ross Greer MSP, of the Greens, said: "We need to make urgent but careful progress in appointing new members of the inquiry. 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."

An NSPCC Scotland spokesman said: "It is vitally important that the Scottish Child Abuse Inquiry is kept fully on track so the loss of two of the three members of the panel within the space of a week is deeply concerning.

"Victims of abuse display great courage in coming forward with their evidence and they must be able to have complete confidence in the inquiry and those leading it."