WASHINGTON — President Donald Trump is asking a federal judge in Maryland to dismiss a lawsuit that argues that Trump's acceptance of payments from foreign and state governments at his Washington hotel violates the Constitution.

A private lawyer for the president wrote in court papers this week that the suit should be tossed because the president cannot be sued in the matter either as an individual or in his official capacity.

At issue is the Constitution's "emoluments" clause, which prohibits a president and other government employees from accepting gifts and payments from foreign or state governments without congressional approval. In this case, the payments come from foreign governments that have patronized the Trump International Hotel near the White House since his inauguration in January 2017.

Ethics experts had warned that this kind of situation could arise because Trump refused to divest from his financial holdings when he became president. Trump instead promised to turn over profits from foreign government business at Trump Organization properties to the U.S. Treasury. The first such annual payment was made earlier this year for $151,470 but the company would not say how that figure was determined.

Maryland and the District of Columbia originally sued Trump only as president, but later accused him as a private citizen after U.S. District Judge Peter Messitte raised that legal issue at a hearing in January. Messitte noted at the time that the original suit was "not challenging a presidential function. They're challenging the president as an individual."

Trump lawyer William S. Consovoy, in his court filing, argued that federal officials can only be targeted for accepting unconstitutional payments in their official government function and not as private citizens. But in the case of the president, Consovoy added, Trump is also "absolutely immune" from legal action in his official capacity.

Consovoy added that "this litigation has the potential to divert the President's attention from his official duties."

Consovoy's arguments suggest Trump "is beyond the reach of the law," said Norman Eisen, chairman of the left-leaning public policy group Citizens for Responsibility and Ethics in Washington, which is a co-counsel with the two jurisdictions against Trump.

Eisen, who was chief ethics officer in the Obama administration, said "the court has already rebuffed one cluster of those arguments relating to Mr. Trump's official capacity, and we will vigorously argue it should do the same here regarding his personal capacity."

A city spokesman said Washington's response would come in upcoming legal briefs. A Maryland official did not immediately respond to a request for comment.

Attorneys in the case are scheduled to argue over the constitutional aspects of the emoluments clause in a hearing June 11.