(CNN) An appeals court handed President Donald Trump a win Wednesday over a challenge to his decision to hold on to his private business interests while in office.

The District of Columbia and Maryland have claimed his Trump International Hotel in Washington harms hotels and other businesses the states partially own. The court's decision effectively keeps the states' attorneys general offices from gathering financial information from the Trump Organization and Trump himself.

"Word just out that I won a big part of the Deep State and Democrat induced Witch Hunt. Unanimous decision in my favor from The United States Court of Appeals For The Fourth Circuit on the ridiculous Emoluments Case. I don't make money, but lose a fortune for the honor of serving and doing a great job as your President (including accepting Zero salary!)," Trump tweeted shortly after the ruling was handed down.

The ruling comes as Trump, who has broken presidential precedent by not divesting his businesses and refusing to release his tax returns, faces an array of legal challenges and inquiries over his finances.

While Trump's win against the states may cap that court challenge, House and Senate Democrats are still pursuing their own challenge of Trump's businesses assets and have sent 37 subpoenas, including to the Trump Organization.

Democrats have demanded a response by July 29 after a federal judge ruled last month that Democrats could proceed with the legal discovery process in their lawsuit. They allege that Trump is breaking the law because the more than 200 members of Congress have not had the opportunity to review his business interests and approve any proceeds from foreign powers, as outlined in the Constitution.

Trump has refused to fully divest from his family's corporate holdings, instead placing his assets in a trust while he is in office and turning over management of his companies to his sons. He also refuses to make public detailed information to verify his worth and income, such as his personal and corporate tax returns.

If the appeals court in Washington, DC, takes a different approach than the Fourth Circuit Court of Appeals, and lets the Democrats continue their pursuit, the question of whether Trump is violating a clause of the Constitution that bars presidents from accepting gifts could be headed to the Supreme Court.

The Fourth Circuit Court of Appeals opinion highlights that the states' competitive business interests may be helped -- instead of hurt, as the states claimed -- by Trump's branding on his Washington, DC, hotel. Some officials may choose to avoid the hotel because it's owned by Trump, the appeals court points out.

"Today's pair of decisions by the 4th Circuit Court of Appeals is a complete victory. The decision states that there was no legal standing to bring this lawsuit in the first place. This latest effort at Presidential harassment has been dismissed with prejudice," said Jay Sekulow, Trump's personal attorney.

The states had claimed they lost business to the Trump International Hotel, because foreign government officials and other state leaders from the US choose to stay there. But the court says that if that's the case, court orders wouldn't stop the Trump International Hotel's business.

"There is a distinct possibility — which was completely ignored by the District and Maryland, as well as by the district court — that certain government officials might avoid patronizing the Hotel because of the President's association with it," the appeals court wrote on Wednesday.

"Even if government officials were patronizing the Hotel to curry the President's favor, there is no reason to conclude that they would cease doing so were the President enjoined from receiving income from the Hotel. After all, the Hotel would still be publicly associated with the President, would still bear his name, and would still financially benefit members of his family."

The appeals court also noted how unusual the case is. The emoluments clause has rarely been interpreted by courts, in part because previous presidents have assiduously avoided the potential for conflicts of interest.

"Not only is this suit extraordinary, it also has national significance and is of special consequence," the panel of three appeals judges wrote.

Department of Justice spokesperson Kelly Laco said: "We are pleased that the Fourth Circuit unanimously decided to dismiss this extraordinarily flawed case. The court correctly determined that the plaintiffs improperly asked the courts to exceed their constitutional role by reviewing the President's compliance with the Emoluments Clauses."

District of Columbia Attorney General Karl Racine and Maryland Attorney General Brian Frosh said in a statement that they intend to "pursue our legal options to hold him accountable."

"The idea that the District of Columbia and Maryland are not harmed by the President's violation of the Constitution is plain error," they said.