WASHINGTON — Maryland's attorney general on Tuesday challenged the appointment of what he called an "unqualified" partisan as acting attorney general and charged the president did it to protect himself from any accusations of wrongdoing.

In a lawsuit, Maryland Attorney General Brian Frosh urged a federal judge to declare that Rod Rosenstein is the acting U.S. attorney general — not Matt Whitaker, who was named to that position last week after the forced resignation of Jeff Sessions.

Whitaker's appointment has been widely criticized because he now oversees the special counsel's investigation of Russian election meddling. 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 Robert Mueller's investigation.

"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," Frosh said, "especially when, as there, the temporary appointee has not been confirmed by the Senate."

Frosh said federal law and the Constitution "protect the country against exactly what President Trump has attempted to do here — pluck an unqualified and unconfirmed partisan to be the nation's chief law enforcement officer in order to protect himself rather than the rule of law."

If the judge does as Maryland asks, ruling that Whitaker cannot serve as attorney general, it would be a blow to President 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 U.S. Supreme Court. Maryland asked the judge to put its motion on a fast track, but there was no indication of when the judge might act.

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 urged 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 argued that the appointment of Whitaker violates a provision of the Constitution which specifies that 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.

Maryland's legal papers said 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 came 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.