WASHINGTON — President Donald Trump faces a growing backlash over his choice of Matt Whitaker to serve as acting attorney general, with liberal and conservative legal experts questioning the appointment.

The controversy arises because Whitaker was serving Jeff Sessions as the attorney general's chief of staff but had not been confirmed by the Senate, and because a federal law specifies that the deputy attorney general takes over when there's a vacancy at the top of the Justice Department.

But in making the choice, Trump bypassed Deputy Attorney General Rod Rosenstein, who had been overseeing special counsel Robert Mueller's investigation into Russian meddling in the 2016 election. Whitaker appears to be the first person named acting attorney general who was not already serving in a Senate-confirmed position.

The president acted under the Federal Vacancies Reform Act, the latest version of a law on the books since 1868. In its current form, it says the president can fill a vacant position at a Cabinet department in one of three ways — designating the deputy to take over, choosing someone nominated by the president and confirmed by the Senate for a different job, or naming someone serving in a senior position in the relevant agency for at least 90 days.

Whitaker fits the third category, because he was named chief of staff to Sessions more than a year ago, in September 2017. His previous Senate confirmation for U.S. attorney in Iowa doesn't count for the purposes of the Vacancies Reform Act, because he stepped down from that position in 2009.

However, a separate federal law specifies that "in case of a vacancy in the office of attorney general, or of his absence or disability, the deputy attorney general may exercise all the duties of that office." So which law governs? It's an issue the courts have never resolved, leaving a cloud over the Whitaker's selection.

Most of the legal criticism of the appointment, however, has been based on a concern that it violates the Constitution. Article II Section 2 gives the president authority to appoint "officers of the United States" with the advice and consent of the Senate. Courts have long made a distinction between principal officers, who require confirmation, and others in lower-level jobs, who do not.

"Principal officers like heads of departments have to be Senate-confirmed," Neal Katyal, a former acting solicitor general in the Obama administration, said. "Our founders put that in for a reason, because you don't want the president's lackey to be serving in such an important role."

Joining Katyal in that view is conservative lawyer George Conway, whose wife, Kellyanne, is a senior Trump adviser. In an opinion column in The New York Times, Katyal and Conway said that because Whitaker has not had a Senate confirmation hearing, "there has been no mechanism for scrutinizing whether he has the character and ability to evenhandedly enforce the law in such a position of grave responsibility."

They cite a concurring opinion written last year by Justice Clarence Thomas in a case about the qualifications of a senior official in another federal agency. "The appointments clause forbids the president to appoint principal officers without the advice and consent of the Senate," Thomas wrote.

Some liberal scholars, while criticizing the selection of Whitaker on other grounds, have nonetheless said the appointment was constitutional. They cite another Supreme Court ruling that said someone acting temporarily in a Cabinet-level job is not a principal officer and therefore doesn't have to be confirmed.

It appears that the issue of who can be acting attorney general has never arisen before, because every person to accept that assignment has been serving in a Senate-confirmed position.

During the past 54 years, six of them have been the deputy attorney general. Others were in other senior Justice Department positions. One, Dana Boente, was a U.S. attorney who was acting attorney general for about a month after Trump fired Sally Yates — who was acting attorney general while the Senate considered Sessions' nomination.

In the 1800s, a secretary of Interior and a secretary of the Navy were each named acting attorney general for a few weeks.

The legality of Whitaker's appointment will probably soon stop being a purely academic question. Local and state officials are already talking about challenging it in court.