WASHINGTON — The state of Maryland asked a federal judge on Tuesday for an order declaring that Rod Rosenstein is the acting attorney general — not Matt Whitaker, who was appointed to that position last week after the forced resignation of Jeff Sessions.

If the judge does as Maryland asks, ruling that Whitaker cannot serve as attorney general, it would be a blow to President Donald Trump, who bypassed Rosenstein in favor of someone who has repeatedly criticized Robert Mueller's investigation of Russian election meddling.

The Justice Department would immediately appeal any such ruling, and the case could be on a fast track to the Supreme Court.

Whitaker's appointment has been widely criticized because he now oversees the special counsel's investigation into Russian election meddling and the president. While serving as a conservative commentator, he questioned the scope of the investigation and said there was no Trump campaign collusion with the Russians. For that reason, several congressional Democrats have urged him to recuse himself from overseeing Mueller's investigation.

Maryland's attorney general, Brian Frosh, a Democrat, argues in court documents filed Tuesday that if Trump had the kind of authority the White House claims, he could fire the attorney general "then appoint a carefully selected senior employee who he was confident would terminate or otherwise severely limit the investigation."

Maryland says that Whitaker's selection by Trump violated federal law and exceeded the appointment authority in the Constitution.

Trump named Whitaker acting attorney general under a law known as the Federal Vacancies Reform Act. It allows a president to fill a vacant Cabinet position with a senior employee of the affected agency. Whitaker fits in that category, because he had been the chief of staff to Sessions.

But Maryland urges the judge to rule that a separate federal law actually governs what happens when the office of attorney general is vacant. It provides that the deputy attorney general takes over, which would be Rosenstein. As the state sees it, the Vacancies Reform Act is more general law, which must give way whenever a specific law provides for filling a Cabinet-level vacancy.

The state also argues that the appointment of Whitaker violates a provision of the Constitution that specifies top positions in the government can be filled only through presidential nomination and confirmation by the Senate. Because Whitaker's nomination bypassed that process, the state says, he cannot serve as acting attorney general.

"It is troubling, to say the least, that the president is attempting to fill a 'vacancy' he created himself with a 'temporary' appointment that might last for many months or years," says Frosh, "especially when, as there, the temporary appointee has not been confirmed by the Senate."

Maryland's legal papers say Whitaker's appointment marks the first time since 1868, when Congress passed a succession law for the Justice Department, that someone named to be acting attorney general was not already serving in a Senate-confirmed position.

The state's motion comes in a lawsuit over the future of Obamacare, seeking a ruling that the Affordable Care Act remains enforceable despite attempts by the Trump administration to shut it down. The case is the mirror image of a lawsuit filed by Texas and 17 other states. It asks a different federal judge to declare that the health care law is no longer enforceable.

Maryland's Obamacare lawsuit named several defendants, including Sessions, who was attorney general when the case was filed in September. With Sessions gone, Maryland says, the judge overseeing the lawsuit should declare that the attorney general defendant is Rod Rosenstein, not Matt Whitaker.