RICHMOND — A federal appeals court seemed openly skeptical Tuesday that President Trump is illegally profiting from foreign and state government visitors at his luxury hotel in downtown Washington or that his financial gain comes at the expense of local competitors.

The three-judge panel of the U.S. Court of Appeals for the 4th Circuit was reviewing a novel case brought by the attorneys general of Maryland and the District of Columbia involving anti-corruption provisions in the emoluments clauses of the Constitution.

The once-obscure clauses were designed to prevent undue influence on government officials but have never been applied in court to a sitting president.

Part of the evidence considered is former Maine Governor Paul LePage’s spending at Trump’s hotel in Washington. Records obtained by the Press Herald show LePage and staff spent at least $22,000 at the hotel in a 2-year period by staying in rooms that cost up to $1,100 a night.

One judge, Dennis W. Shedd, suggested the president may actually be driving up business at other local hotels because of people who would be drawn to Washington to protest Trump’s policies and would not choose to stay at the president’s namesake hotel.

Another, Paul V. Niemeyer, noted the president had already stepped back from day-to-day management of the Trump International Hotel. Forcing the president to give up his financial interest would not remove the Trump name from the business, the judge said, and foreign dignitaries would still book rooms and events at the venue.

The judges repeatedly pressed the attorney representing D.C. Attorney General Karl A. Racine (D) and Maryland Attorney General Brian E. Frosh (D) about the specific remedy the two jurisdictions are seeking and about their intentions.

“What solves the concerns you have?” Shedd said, asking whether divestment of a hotel or putting it into a blind trust might be an answer.

Niemeyer, addressing attorney Loren AliKhan, said: “You filed the lawsuit and you don’t even know what real-world relief would satisfy. You seem to be ducking the question.”

AliKhan said Trump, in his role as president, is violating the foreign and domestic emoluments clauses of the Constitution by choosing to maintain his business interests.

“The official action is the accepting of emoluments, which is a violation of the Constitution,” AliKhan told the court. Divestment, she said, might be an “option.”

The third judge on the panel, A. Marvin Quattlebaum Jr., is a recent Trump nominee to the court. Quattlebaum appeared concerned about a broad definition of emoluments. Would it mean, he asked, that presidents would have to give up Treasury bills and federally insured bank accounts?

“My view is it covers any profit, gain or advantage,” AliKhan said of an emolument, but she stopped short of saying a Treasury bill or other passive investment would qualify.

The Trump administration attorney told the court that Maryland and the District have no authority to sue the president in his official capacity over payments the president’s business accepts from state and foreign governments.

“The president is unique” in our system of government, said Justice Department attorney Hashim M. Mooppan. “He’s not just any old inferior officer. . . . That’s why he gets absolute immunity.”

The panel specifically is considering whether the District and Maryland have legal grounds, or standing, to sue the president in the first place. And the appeals court will consider the president’s request to dismiss the case outright or to take the unusual step of ordering the lower-court judge to permit a midstream appeal.

A federal judge in Maryland allowed the case over the Trump hotel to move forward and adopted a broad definition of the ban to include “profit, gain, or advantage” received “directly or indirectly” from foreign, federal or state governments.

Trump and his attorneys appealed, saying in court filings that the president should be shielded from such liability and legal distractions. They also are trying to stop an order from U.S. District Judge Peter J. Messitte authorizing dozens of subpoenas to federal government agencies and Trump’s private business entities.

The subpoenas seek details on some of the most closely held secrets of Trump’s business and finances: Which foreign governments have paid the Trump Organization money? How much? And for what?

All of the documents — including marketing materials targeted to foreign embassies, credit card receipts and restaurant reservation logs — relate to Trump’s Washington hotel.

“The complaint rests on a host of novel and fundamentally flawed constitutional premises, and litigating the claims would entail intrusive discovery into the president’s personal financial affairs and the official actions of his Administration,” the Justice Department said in a court filing.

“Despite this remarkable complaint, the district court treated this case as a run-of-the-mill commercial dispute,” the filing continued. “Not only did it deny the president’s motion to dismiss, but it refused even to certify for immediate appeal.”

The Richmond-based 4th Circuit court, which takes appeals from Maryland, temporarily put the subpoenas on hold while the case is pending.

Unlike past presidents, Trump has retained ownership of his private businesses, including the hotel on Pennsylvania Avenue NW, a few blocks from the White House, that has attracted government clients. The Kuwaiti Embassy has held its National Day celebration there three years in a row. Lobbyists representing the Saudi government reserved blocks of rooms in December 2016. The former governor of Maine stayed at the hotel and dined at its restaurant in 2017.

Mooppan said there was no evidence Maryland or the District had been harmed by the Maine governor’s trip: “This case should be over.”

Despite the case — and a separate emoluments suit brought by 198 Democrats in Congress — the Trump Organization did more business with foreign governments in 2018 than it did the year before. The company said it received $191,000 in profits from large events and hotel bookings paid for by foreign governments last year, money it donated to the U.S. treasury. The previous year the company reported about $150,000.

In January, the inspector general for the General Services Administration said the agency had “improperly ignored” potential conflicts with the emoluments provision in leasing the Old Post Office building to the hotel. The watchdog agency did not recommend that the GSA modify the deal, but several House committees are now planning investigations of the project.

In his initial ruling in March 2018, Messitte found that Maryland and the District had sufficiently shown that Trump’s hotel “has had and almost certainly will continue to have an unlawful effect on competition.” He specifically noted the local governments’ financial interests in the Walter E. Washington Convention Center and the Bethesda North Marriott Hotel and Conference Center, which offer venues that may compete for some events.

The provisions being reviewed by the 4th Circuit have never been tested at a federal appeals court. One bars federal officers from taking presents, or emoluments, from foreign governments. The other prohibits presidents from taking side payments from individual states.

The Justice Department had urged Messitte to dismiss the case, arguing that the clauses were meant to stop officials from taking bribes — but not to prevent them from doing business.

The Office of Legal Counsel within the Justice Department has routinely addressed the meaning and implications of the provisions for presidents past. President Ronald Reagan requested a guidance about whether he could accept the pension he earned as California’s governor. President Barack Obama accepted the Nobel Peace Prize only after the legal counsel’s office said he could do so without violating the emoluments clause.