WASHINGTON — A federal judge Wednesday refused to throw out a lawsuit against President Donald Trump that accuses him of improperly benefiting financially when foreign or state governments stay or use space at his hotel just a few blocks from the White House.

The attorneys general of Maryland and Washington, D.C., claimed that Trump is violating the Constitution's emoluments clauses, which bar the president from receiving "any present, emolument, office or title of any kind whatever from any king, prince, or foreign state" or from any domestic state.

Trump's lawyers asked the judge in the case, Peter Messitte, to throw the case out. They argued that the term "emolument" has a very specific meaning — a payment made to a public official in addition to the official salary. Under that reading, financial benefits from an office holders private business dealings would be exempt.

But Judge Messitte ruled Wednesday that the Constitution's framers understood the term to have a broader meaning, applying to any profit, gain, or advantage. "The emoluments clauses are intended to protect against any type of potentially improper influence by foreign, the federal, and state governments upon the president."

The governments of Kuwait, Malaysia, the Philippines, and Romania have done business with the Trump International Hotel in Washington, and Judge Messitte's ruling said some foreign governments have indicated that they patronized the hotel "precisely because of the president's association with it."

The state of Maine did business with the hotel, too, the judge noted. And he said the president has benefited from the federal government because the General Services Administration leased the site to the Trump Organization.

Karl Racine, Washington, D.C.'s attorney general, praised the decision. "We are one step closer to stopping President Trump from violating the Constitution's original anti-corruption provisions."

Wednesday's ruling appears to be the first time any federal judge has said what the term "emolument" means when applied to a president. The Justice Department could appeal the decision, which allowed the lawsuit to go forward and rejected a call from the government to dismiss the case.

Unless an appeals court puts the lawsuit on hold, the next step would be for the plaintiffs to seek access to the Trump International Hotel's records to identify customers from foreign and state governments.

Wednesday's ruling clears a second legal hurdle from the case. The judge ruled in March that Maryland and D.C. had the legal standing to bring their claim.