Justice Ruth Bader Ginsburg said Thursday that she should not have publicly criticized presumptive Republican presidential nominee Donald Trump and that she would be more “circumspect” in the future to avoid commenting on partisan politics.

The senior member of the Supreme Court’s liberal wing had criticized Trump in three separate media interviews since last week, calling him a “faker” and saying she feared for the country and the Supreme Court if he were elected.

Those comments — unprecedented in modern Supreme Court custom — brought criticism and questions over ethics even from usual allies, who said Supreme Court justices should not insert themselves into the elections. The judicial ethics code that binds lower-court judges — but not Supreme Court justices — forbids judges from endorsing or speaking about candidates.

[Ginsburg, always outspoken, may have trumped herself]

In a statement issued Thursday by the court’s public information office, Ginsburg seemed to agree with the criticism, although she did not offer an apology to Trump, who had demanded one.

The Notorious RBG isn’t backing down from her negative comments about Republican presidential candidate Donald Trump, and now he’s calling for her resignation from the Supreme Court. Here’s a quick rundown of what the two have said. (Jenny Starrs/The Washington Post)

“On reflection, my recent remarks in response to press inquiries were ill-advised and I regret making them,” Ginsburg said. “Judges should avoid commenting on a candidate for public office. In the future I will be more circumspect.”

Last week, Ginsburg publicly slammed Trump and what his possible presidency would mean for the court.

“I can’t imagine what this place would be — I can’t imagine what the country would be — with Donald Trump as our president,” Ginsburg told the New York Times. “For the country, it could be four years. For the court, it could be — I don’t even want to contemplate that.”

She made similar comments to the Associated Press. On Monday during a CNN interview, Ginsburg called Trump a “faker” and said she was surprised that the media has not pressed him more to release his tax returns.

[War of words between Ginsburg and Trump]

Trump quickly fired back, saying in a tweet that the 83-year-old justice should resign and that her mind was “shot.” He has not commented on her statement.

Legal ethics experts had criticized Ginsburg, and some said her comments would raise recusal issues should litigation involving Trump arrive at the court.

1 of 11 Full Screen Autoplay Close Skip Ad × These Republican leaders won’t be going to the Convention in Cleveland View Photos Some will be campaigning. Some will be mowing their lawn. Caption Some will be campaigning. Some will be mowing their lawn. Ohio Gov. John Kasich Kasich has declined to endorse Trump and is spending convention week meeting with state delegations and other Republican groups. Gary Landers/AP Buy Photo Wait 1 second to continue.

“She should not have made the comments she made and given Trump the opportunity to try to recuse her,” said Richard Painter, a judicial ethics expert at the University of Minnesota.

He said he thought her statement would end the issue, and recusal was not required just because a justice says out loud what it seems likely she believes.

“I don’t think anyone thinks Justice [Sonia] Sotomayor or Justice [Stephen] Breyer is going to vote for Donald Trump, but that doesn’t mean they should be recused” from litigation involving Trump, Painter said

The court — now at eight members after the death of Antonin Scalia in February — is a major issue in the presidential race, with both Republicans and Democrats saying the appointment of the next justice could have a significant impact on future rulings.

Ginsburg grants more media interviews than other justices, and she is more outspoken. She previously has been criticized by conservatives for comments she has made about abortion rights and about the direction of the court.

But the comments about Trump were more specific and drew fire even from those who dislike the Republican; the editorial boards of The Washington Post and New York Times said she should stay out of the political ring.

It was unclear what led Ginsburg to make her statement. The justices operate independently, and it is unlikely that any of her colleagues had any say in her decision.

Brian Murphy contributed to this report.