The judges instead selected her deputy, career prosecutor Desiree Leigh Grace, to take over the role. No reason was given for the decision.

Habba has clashed with Democrats since taking office in March.

During her tenure, she has filed assault charges against a Democratic congressman, and opened investigations into the state’s Democratic governor and attorney general.

US Deputy Attorney General Todd Blanche said in a post on Monday that she had the backing of Trump and the justice department, and dismissed criticism of her as “political noise.”

After the ruling from the 17 judges, he again took to X to accuse the judges of pushing “a left-wing agenda, not the rule of law”.

“When judges act like activists, they undermine confidence in our justice,” he wrote.

Exactly when Habba’s term expires is the subject of some confusion. She was named by Trump on 24 March “effective immediately”, meaning her 120 day term would expire on Tuesday. However she was officially sworn in four days later, on 28 March in an Oval Office ceremony.

Both of New Jersey’s senators – who are each Democrats – have opposed her nomination to be the US attorney for the state, arguing that she has pursued “frivolous and politically motivated” prosecutions and “did not meet the standard” for the office.

It is uncommon for judges to oppose an interim prosecutor from staying on, absent confirmation from the US Senate.

But a similar situation played out last week in New York, where judges also voted to block the interim US attorney from staying on.

John Sarcone III departed the role, but will stay on as an “special attorney to the attorney general”, according to the justice department.

It is unusual for judges to choose someone other than the interim US attorney, although choosing the first assistant “is generally a sensible choice,” said University Richmond law professor Carl Tobias.

He added that Desiree Grace “is well respected in the New Jersey legal world”.