WASHINGTON — The Justice Department pushed back on Wednesday against accusations that President Trump’s appointment of Matthew G. Whitaker as acting attorney general was illegal, arguing that it complied with both federal statutes and the Constitution — and that it fit within a history of similar designations dating back to the earliest days of the country.

The Trump administration made its case in a 20-page memorandum by Steven E. Engel, the head of the department’s Office of Legal Counsel. It came a day after the State of Maryland asked a Federal District Court judge to issue an injunction declaring that when Mr. Trump ousted former Attorney General Jeff Sessions, the role of acting head of the department passed instead to the deputy attorney general, Rod J. Rosenstein, as a matter of law.

[Read the Office of Legal Counsel opinion.]

But even as the Trump administration offered its most complete argument to date that Mr. Whitaker’s designation as acting head of the Justice Department was lawful, it continued to sidestep questions about whether ethics rules required Mr. Whitaker to recuse himself from overseeing the special counsel investigation by Robert S. Mueller III into whether Mr. Trump’s associates conspired with Russia in its election interference.

Mr. Whitaker has been an outspoken critic of the investigation, making clear that he has already decided that no Trump associates conspired with Moscow’s election disruption. He unsuccessfully interviewed in 2017 for the job of the White House’s top lawyer defending against the inquiry, and is friends with Sam Clovis, a witness in the investigation.