Promising to be more discreet in the future, the leader of the court’s liberal wing said in a statement that judges should not comment on candidates for any public office.

“On reflection, my recent remarks in response to press inquiries were ill-advised and I regret making them,” the 83-year-old justice said.

Ginsburg told The Associated Press last week that she did not want to think about the prospect of the Republican winning the presidency over Democrat Hillary Clinton. She escalated her criticism in subsequent media interviews, including calling Trump a “faker” who “really has an ego,” in a CNN interview.

Trump jumped into the fray on Wednesday. He tweeted that Ginsburg was an embarrassment for making “very dumb political statements about me. Her mind is shot – resign!” In subsequent tweets, Trump called Ginsburg “incompetent” and wondered whether she would apologize.

“She oughta stay out of it,” said Senate Judiciary Committee Chairman Chuck Grassley, R-Iowa. “It hurts the court when she does that.”

Ginsburg was appointed to the high court in 1993 by Clinton’s husband, former President Bill Clinton. She said in the AP interview that she expects the next president, “whoever she will be,” probably will make several Supreme Court appointments. Two other justices in their late 70s, Stephen Breyer and Anthony Kennedy, also could retire in the next few years.

The Supreme Court already had been an issue in the presidential campaign, even before Justice Antonin Scalia died in February. The battle over filling his seat elevated the court’s prominence even further. President Barack Obama nominated federal Judge Merrick Garland in March, but Senate Republicans have refused to hold hearings or a vote on confirming him. They say Scalia’s seat should be filled by the next president.

The justices’ political leanings are easy to discern. Most spent years before they became judges in jobs that identified them as Democrats or Republicans. Chief Justice John Roberts worked in the White House counsel’s office during the Reagan administration. Breyer was a top Senate Judiciary Committee aide to Democratic icon Edward Kennedy.

Scalia’s 2004 duck-hunting trip with then-Vice President Dick Cheney prompted calls for Scalia to step aside from a Supreme Court case. He scoffed at the idea that his impartiality was in question, then voted in the majority to keep private the details of White House strategy sessions on energy policy.

Ginsburg’s remarks in separate interviews with AP, the New York Times and CNN were unusual in that she openly expressed her preference for one candidate over another.

The comments raised the question of whether she could remain fair if the court were asked to hear a case involving Trump, especially one over the outcome of the election as in 2000.

Ginsburg herself would decide whether she could take part.

“In the case of an election dispute, a call for Justice Ginsburg’s recusal is all but inevitable. She would decide the motion herself, however, and it seems likely that this retraction would lead her to reject it,” said Northwestern University law professor Steven Lubet.

Arthur Hellman, an ethics expert at the University of Pittsburgh, said the apology may not be enough.