ALEXANDRIA, Va. — Lawyers for New York Attorney General Letitia James and former FBI boss James Comey are set to argue Thursday that the criminal cases against them should be tossed because President Trump’s handpicked prosecutor Lindsey Halligan is illegitimate.

James was charged with federal criminal counts of bank fraud and making false claims to a financial institution that allegedly netted her $19,000 in savings for a loan on a second home.

Comey — an ex FBI director — is charged with lying to Congress about leaks to the press involving agency probes.

Lawyers for New York Attorney General Letitia James are expected to argue that prosecutor Lindsey Halligan’s appointment was unlawful and the case against James should be tossed out. Getty Images

Both Comey and James have claimed they have been targeted by Trump because of their past investigations into Trump.

James and Comey have both pleaded not guilty and their lawyers are are duking it out in Alexandria federal court with prosecutors about the legitimacy of their cases because of the allegations that Halligan — the interim US Attorney for the Eastern District of Virginia — was unlawfully installed in her position by the Trump administration.

District Judge Cameron McGowan Currie — an appointee of former President Bill Clinton — is slated to hear arguments in both cases Thursday morning.

Halligan, a former pageant queen who practiced insurance law, was on Trump’s legal team and worked in the White House before her appointment as interim US attorney.

James and Comey’s legal teams have claimed Attorney General Pam Bondi didn’t have the authority to appoint Halligan to the temporary seat because Bondi already used up her one 120-day temporary appointment on Halligan’s predecessor.

Any new appointment to the prosecutorial post would have to be made with the advice of Congress, James and Comey’s lawyers have claimed.

James faces up to 60 years behind bars and a $2 million fine if convicted on both counts. Luiz C. Ribeiro for New York Post

Lindsey Halligan speaks with a reporter outside the White House on Aug. 20. AP

But the lawyers for the government have claimed Bondi can appoint multiple people to the vacant seat so long as they only remain in office for 120 days. 

The feds have argued the prosecution against James and Comey are legitimate and public officials must be held to a higher standard.

Start your day with all you need to know

Morning Report delivers the latest news, videos, photos and more.

Thanks for signing up!

But the lawyers for the government have claimed Bondi can appoint multiple people to the vacant seat so long as they only remain in office for 120 days.

James is accused of buying a three-bedroom, one-bathroom home in Norfolk on Aug. 17, 2020, using a $109,600 loan.

Former FBI Director James Comey speaks during a Senate Intelligence Committee hearing on Capitol Hill in 2017. AP

James is accused of bank fraud for allegedly claiming a second home in Norfolk, Va., would be her second home when in fact her grandniece lived there and paid rent. James has pleaded not guilty. Paul Martinka

James allegedly said she would be the “sole borrower to occupy and use the property,” when in reality her grandniece lived there and paid rent, the feds claim.

James faces up to 60 years behind bars and a $2 million fine if convicted on both counts.

Comey is accused of lying during a 2020 Senate Judiciary Committee hearing when he claimed he didn’t authorize leaks to the media about his probe into 2016 presidential candidate Hillary Clinton’s use of private email servers.

Comey faces up to five years in prison and a fine of up to $250,000 if convicted on both counts.

Both James and Comey face trials in January.