A US appeals court has ruled that President Donald Trump's former personal lawyer, Alina Habba, has been unlawfully serving as top federal prosecutor for New Jersey - a ruling likely to affect scores of criminal cases in the state.

The president handpicked Habba for the role of US attorney this year, but a district court rejected her nomination. The Trump administration subsequently installed her in a position that allowed her to serve on an acting basis.

The appellate judges found on Monday that this tactic, which bypassed Senate confirmation, violated the Federal Vacancies Reform Act. Notably, Habba is the second Trump-appointed prosecutor to be disqualified within recent weeks.

It is apparent that the current administration has been frustrated by some of the legal and political barriers to getting its appointees in place, noted Judge Michael Fisher, one of the appellate judges, in the ruling disqualifying Habba.

The BBC has reached out to Habba's office, the White House, and the Department of Justice for comment.

In a joint statement, three lawyers who challenged Habba's authority declared that this marks the first time an appeals court has ruled that President Trump cannot usurp longstanding statutory and constitutional processes to insert whomever he wants in these positions.

They emphasized their commitment to continue challenging unlawful appointments of US Attorneys as necessary.

Alina Habba, 41, joined Trump’s legal team in 2021 after meeting him at his golf club in New Jersey. She was appointed to represent Trump during significant legal challenges, including his hush-money trial in New York last year, where he was convicted on multiple counts.

This ruling not only questions Habba’s authority but may also necessitate the Justice Department to appoint a new prosecutor to oversee federal cases in New Jersey.

The appellate court’s decision arose after three men facing charges in New Jersey argued that Habba’s appointment lacked legal standing. This was supported by a federal judge's ruling in August, which had been held in abeyance while the appeals court deliberated.

Habba's disqualification is part of a broader pattern of legal fissures around Trump-appointed prosecutors, with recent cases involving other disqualifications in Virginia and Nevada.