Dusk outside the Trump International Hotel in Washington on July 15. (Evelyn Hockstein/For The Washington Post)

A federal judge on Thursday appeared skeptical of an effort by the Justice Department to throw out a lawsuit against President Trump alleging his company's business with state governments and foreign countries violates the Constitution.

U.S. District Judge Peter J. Messitte seemed receptive to arguments from the attorneys general of Maryland and the District of Columbia, who said that payments to Trump properties from those entities could amount to illegal gifts.

The Justice Department, which is defending Trump, called the suit politically motivated and said the Democratic attorneys general wanted to conduct a "fishing expedition" in the private files of the president's business. The department's lawyers also argued that the District and Maryland lacked standing to sue Trump in the first place because they wouldn't suffer any specific injury.

But Messitte repeatedly challenged the Justice Department's assertions, giving the plaintiffs the impression that the judge would rule in their favor.

"We came in confident. We leave more confident," D.C. Attorney General Karl A. Racine said after the hearing. He called the Trump International Hotel in the District — his own jurisdiction — a "den of iniquity" because, he alleged, it was seen as a place where money could buy influence.

Thursday's hearing was the beginning of just one legal fight centering on how Trump balances his duties as president with the business empire that bears his name.

Although Trump resigned from his management position in the company when he entered the White House, he still benefits financially from his businesses, which include residential, office, hotel and golf properties in the United States, Europe and South America.

The Trump Organization has referred questions about the case to the government.

The case heard Thursday centers on two little-tested constitutional provisions known as the emoluments clauses. Written to stop officials of early America from being swayed by gifts, they bar the president from taking so-called emoluments from either foreign governments or individual states.

No court has considered the merits of an emoluments case previously, and attorneys for the plaintiffs say they believe the U.S. Supreme Court may ultimately weigh in regardless of the outcome at the district court level.

The question of standing — whether the two jurisdictions have the right to bring a case — was central to Thursday's hearing, which was called to deal with the Justice Department's motion to dismiss. If Messitte sides with Trump, the case will be thrown out.

But if he sides with Maryland and the District, the case could proceed to a discovery phase, meaning that the plaintiffs could seek records from Trump's businesses, including his hotel in downtown Washington.

In his arguments, Brett Shumate, the attorney for the Justice Department, contended that the lawsuit's true intent was to give the attorneys general access to internal Trump Organization documents, in the legal discovery process that would follow if Messitte allows the case to continue.

"What we have here is an abstract political disagreement with the president's conduct, without any concrete impact on the state," Shumate said. "They don't get to do a fishing expedition, with discovery, of the president's businesses."

In his questioning of Shumate, Messitte challenged the Justice Department's argument that it was only speculation that Trump's business had drawn clients away from others. He cited two embassy parties mentioned in a Washington Post story: Bahrain and Kuwait held expensive embassy parties at Trump's D.C. hotel after the election.

"You have diplomats from certain Arab countries that are declaring that they are taking their business [to Trump's hotels] in order to curry favor with the president," Messitte said. "Do you need a number on that" loss of business to pursue the case further?

He also sounded skeptical of the idea that this lawsuit was merely a political argument cloaked in the form of a lawsuit.

"What's the political angle for suing the president for taking money from a private business?" the judge said.

And he repeatedly questioned Shumate on the standing question, asking: If Maryland and the District can't sue, then who can?

"Does anybody ever have standing, based on your argument?" Messitte said.

At the hearing's conclusion, Messitte asked both sides what they would do next if he was to rule against Trump and let the case proceed. Attorneys for the District and Maryland said they would want to examine Trump Organization business records — from the D.C. hotel, but also from other Trump properties — to get details on payments from foreign governments and states.

Thursday's hearing barely touched another key question: What counts as an emolument? Trump's attorneys have argued that the term should not cover business transactions, where a foreign client paid Trump's business for something like a round of golf or a banquet room.

In dueling court papers, the two sides offered competing visions for what the country's founders intended the emoluments provisions to mean — and to prevent.

Racine and Maryland Attorney General Brian Frosh argued in filings that when Maryland joined the United States, it did so with the understanding that it would be free from "uncertainty about whether the President is acting in the best interests of the American people."

"The theory underlying the clause, informed by English history and by the Framers' experience, is that a federal officeholder who receives something of value from a foreign government can be imperceptibly induced to compromise what the Constitution insists be his only loyalty: the best interest of the United States of America," the filings said.

The plaintiffs also argued that competing hotels in Maryland and the District have been harmed by Trump's D.C. hotel and that the U.S. General Services Administration, which handles federal real estate, wrongly allowed Trump's company to continue to lease the Old Post Office building (where the hotel operates), even though a clause in the contract said no elected official could remain on the lease.

Justice Department attorneys responded with their own view of the framers' intentions. In asking that the case be dismissed, they raised the example of George Washington, newly elected as president, buying several plots of land from the then-territory of the District of Columbia, through a sale Washington had approved as president. Justice attorneys argued that at the time "no concern was raised that such transactions conferred a benefit, and thus a prohibited emolument, on Washington.

A similar court case, brought by a nonprofit group in the District, was dismissed by a federal judge in New York who ruled that the Founding Fathers had intended Congress, not the courts, to enforce this rule against the president.

In his questioning on Thursday, Messitte sounded as if he did not think that the previous ruling settled the issue. "I searched it carefully. I just couldn't see what the rationale was," he said.

A judge has not yet ruled on a suit from nearly 200 Democratic members of Congress, filed in March. A judge in a third suit, brought on behalf of Cork Wine Bar in Northwest Washington, ruled Jan. 2 that the case would be heard in federal court and not D.C. Superior Court, making it more likely that it could be dismissed as well.