Three federal ministers who criticised the highest court in Victoria during an active terrorism appeal will not be charged with contempt of court, despite the Victorian chief justice, Marilyn Warren, warning them there was a prima facie case against them.

The health minister, Greg Hunt, the human services minister, Alan Tudge, and the assistant treasurer, Michael Sukkar, criticised Warren and her court of appeal colleagues justices Stephen Kaye and Mark Weinberg in comments published on the front page of the Australian last Monday, calling them “hard-left activist judges” and declaring the court itself an “ideological experiment”.

In a special hearing called by the solicitor general, Stephen Donaghue, on behalf of the ministers at the supreme court in Melbourne on Friday, the ministers apologised “unreservedly” for their comments and withdrew them in full, saying they were incorrect and uninformed.

The apology came a full week after the ministers, through Donaghue, were heavily criticised by Warren, Kaye, and Weinberg for failing to apologise for or fully withdraw their comments, which Warren said had the effect of appearing to attempt to influence the court.

At a hearing last week the ministers each withdrew their most egregious remark but declined to apologise. But for the apology offered on Friday, Warren said, the ministers would have been charged with a breach of sub judice.

None of the ministers appeared in person but Donaghue read a statement from them to the court.

“Since the hearing before the court of appeal last Friday, each of us has watched the recording of that hearing and read the transcript of the court of appeal hearing on 9 June,” the statement said.

“As a result of hearing both of those things, we have realised that we should have offered our unconditional apology to the court for our comments to the Australian on 13 June. We offer that apology now and unreservedly withdraw all comments made in relation to this matter.”

The 9 June hearing was a sentencing appeal brought by the commonwealth against two Victorian men charged with terrorism offences, on the grounds that their sentences had been manifestly inadequate. The judgments on those appeals were handed down on Friday morning, with both men getting heavier sentences.

Comments by the judges at that hearing about comparative sentencing between states, which were reported by the ABC, were the basis for the ministers’ criticism of the court.

At the hearing last week, Donaghue conceded the ministers were “ignorant” about the details of that case and the context of the remarks they had criticised, and had not turned their mind to the fact that it was an active court case.

“Our understanding of what had occurred during that hearing was inadequate,” the ministers’ statement said.

“Now that we have read the transcripts, it’s clear to us just how inaccurate our comments were … had we understood the true context at the time we would not have made those comments.”

The ministers’ said they would “undertake to exercise more care in the future to avoid making any remarks” without understanding the full context.

Warren said that on their face, the statements made by the ministers to the Australian “failed to regard the doctrine of separation of powers, breached the doctrine of sub judice, and reflected a lack of proper understanding of the importance to our democracy of the independence of the judiciary from the political arms of government”.

She said there was a prima facie case against both the ministers and the publication for a “serious breach of sub judice”, saying she did not accept the latter’s argument that it was “merely the messenger”.

Warren said the court “repeatedly noted there was no apology” from the ministers, and that some of the submissions made by Donaghue on behalf of the ministers provoked “expressions of doubt, even incredulity, from the court”.

She criticised the ministers for taking so long to offer an apology and fully withdraw their comments, noting this came after a “stern discussion between the bench and the solicitor general” and substantial media commentary.

“On one view, it has only been after stern discussion from the bench and commentary in the media that the ministers have understood and apologised for their contempt,” she said. “The delay is most regrettable and aggravated the contempt.”

Nevertheless, she said, the apology was sufficient to purge their contempt.

The Australian newspaper, its publisher, Nationwide News, and its national political editor, Simon Benson, who wrote the front-page story detailing the minister’s comments, will also face no charges. Unlike the ministers, the Australian offered a full apology at the first hearing. The story was still online on Friday.

Warren said contempt of court laws existed to protect the right of accused persons to a fair trial, not to protect the reputation of the court, and that it was very concerning to see three senior ministers, all of whom trained as lawyers, put that at risk.

“The court has accepted in this instance the two apologies and retractions proferred,” she said. “It should not have come to this, namely two hearings. But for the apologies and retractions, we would have referred the groups, namely the ministers and the Australian parties, to the prothonotary of the supreme court for prosecution for contempt of court.”

She said the ministers’ conduct had been “fundamentally wrong” and would not be tolerated in future.

“It would be a grave mistake for the administration of justice if it were to reoccur. The court will not hesitate to uphold the rights of citizens who are protected by the sub judice rule.”