The Trump administration defended the legality of Matthew Whitaker’s appointment as acting attorney general Wednesday, issuing a legal opinion saying that U.S. presidents throughout history had installed officials as temporary cabinet members without Senate approval.

The Justice Department’s opinion is aimed at critics who say Mr. Whitaker’s installation is an invalid run around the Constitution’s requirement that the Senate provide “advice and consent” for senior executive-branch nominations. It comes a day after the state of Maryland asked a federal judge to block Mr. Whitaker from serving, arguing that job should fall to Deputy Attorney General Rod Rosenstein.

A judge Wednesday set a hearing on that argument for Dec. 19.

The opinion is likely to further the debate that has surrounded Mr. Whitaker since President Trump named him to replace Jeff Sessions, who was ousted last week. Even before Mr. Sessions’ resignation, the department’s Office of Legal Counsel had advised the White House that Mr. Trump could lawfully name Mr. Whitaker as his successor, a senior department official said Wednesday.

“It is no doubt true that presidents often choose acting principal officers from among Senate-confirmed officers. But the Constitution doesn’t mandate that choice,” the head of the office, Steven A. Engel, wrote in Wednesday’s opinion, addressed to White House layer Emmet Flood. “Consistent with our prior opinion and with centuries of historical practice and precedents, we advised that the president’s designation of Mr. Whitaker as acting attorney general on a temporary basis” didn’t warrant Senate confirmation.