That didn’t take long. On Tuesday, Maryland asked a federal court to rule that Matthew Whitaker may not lawfully serve as acting attorney general. The state’s motion has a real chance of success. Whitaker, whom Donald Trump elevated to the role after firing Attorney General Jeff Sessions last week, does appear to be exercising his power illegally. If a court agrees, it could replace Whitaker with Deputy Attorney General Rod Rosenstein—allowing the deputy AG to resume oversight of Robert Mueller’s Russia investigation.

Maryland Attorney General Brian Frosh, assisted by the law firm Goldstein and Russell, filed Tuesday’s motion as part of ongoing litigation over the Affordable Care Act. The state is defending the ACA against attacks by Republican attorneys general, as well as the Justice Department itself, which asserted that large swathes of the law are illegal now that Congress has effectively repealed its individual mandate. (That argument should be considered nonsense.) Maryland, in other words, is going up against the attorney general. But it believes that Whitaker, who purports to be acting attorney general, has assumed this role unlawfully. And it wants U.S. District Judge Ellen Hollander to rule that Rosenstein, not Whitaker, is the true acting AG.

The state puts forth two main arguments, both of which I explained here, to claim that Whitaker’s service violates the law. First, it argues that Trump has ignored the Attorney General Succession Act, which Congress passed to clarify rules of succession in the Justice Department. This law states that, “in case of a vacancy in the office of Attorney General,” the deputy attorney general “may exercise all the duties of that office.” This rule would require Rosenstein, not Whitaker, to step in as acting attorney general, since Rosenstein is deputy AG, and Whitaker previously served as Sessions’ chief of staff.

Trump believes he can appoint Whitaker under the Federal Vacancies Reform Act, which would allow Whitaker to serve as acting AG temporarily—if it applied here. But it shouldn’t. The FVRA notes that it is not the “exclusive means” for filling a vacancy.” Rather, when a different “statutory provision expressly … designates an officer” to step in “temporarily in an acting capacity,” that other provision should control. The Attorney General Succession Act does just that: It explicitly assigns the deputy AG the “duties” of the attorney general when he leaves office. Maryland therefore claims, quite sensibly, that the FVRA yields to the Attorney General Succession Act, making Rosenstein—not Whitaker—the real acting attorney general.

There’s a second, even more powerful argument Maryland raises to challenge Whitaker’s authority. Under the Appointments Clause of the U.S. Constitution, any “principal officer” must be confirmed “with the Advice and Consent of the Senate.” The attorney general is undoubtedly a principal officer, yet Whitaker has not been confirmed by the Senate for this position, or any other in the Trump administration. How, then, can he serve lawfully? According to Supreme Court Justice Clarence Thomas, he cannot. In 2017, the justice wrote that the president may never appoint a principal officer without Senate confirmation. The fact that an appointee serves in a temporary “acting” capacity “does not change the analysis,” Thomas wrote. “I do not think,” he concluded, that “the structural protections of the Appointments Clause can be avoided based on such trivial distinctions.”

If the FVRA truly does allow Whitaker to serve as acting AG, then, the law itself may be unconstitutional. Congress cannot authorize a president to appoint a federal officer in violation of the Constitution. But under the longstanding canon of constitutional avoidance, the courts should attempt to interpret statutes in a way that avoids constitutional issues. Here, that requires Hollander to hold that federal statute makes Rosenstein, not Whitaker, acting attorney general.

“Rod Rosenstein, not Mr. Whitaker, is the Acting Attorney General as a matter of law,” Maryland concluded, “with the attendant responsibility to enforce federal law and oversee this litigation in particular.” The court “should find that the Constitution cannot be so easily circumvented.”

Hollander, a Barack Obama appointee, may hesitate to take the unusual step of disqualifying the acting attorney general from his position. She really shouldn’t have any such qualms. It’s quite likely that a majority of the Supreme Court would rule to do just that, with Clarence Thomas joining the more liberal justices to hold that Whitaker cannot constitutionally perform the powers of the office he purports to occupy. Trump is simply not authorized to short-circuit the Attorney General Succession Act and the Appointments Clause to install Whitaker at the head of the Justice Department. The courts should not shy away from their duty to enforce the law against the man illegally serving as the nation’s chief law enforcement officer.