A federal judge on Monday dismissed President Donald Trump's lawsuit to prevent the House Ways and Means Committee from utilizing a recently passed New York law providing the panel an avenue to pursue his state tax returns.

Judge Carl Nichols of the U.S. District Court for the District of Columbia ruled that his court was not the proper jurisdiction to sue the New York officials named in the lawsuit, leaving open the option that Trump do so in New York.

In his lawsuit, Trump sued to preemptively block the House Ways and Means Committee from requesting the returns, New York Attorney General Letitia James from enforcing the law, and to stop the New York Department of Taxation from furnishing the documents. Trump argued his lawsuit was necessary to prevent his state returns from being disclosed to Congress before a court could hear his opposition.

The House Ways and Means Committee, chaired by Rep. Richard Neal, D-Mass., has not requested Trump's state returns through the new New York law.

"Based on the current allegations, Mr. Trump has not met his burden of establishing personal jurisdiction over either of the New York Defendants," Nichols, a Trump appointee, wrote. "The Court therefore need not reach the question of proper venue. Accordingly, the New York Defendants’ Motion to Dismiss is granted, and Mr. Trump’s Amended Complaint is dismissed without prejudice as to them."

Nichols also ruled that Trump did not sufficiently establish a conspiracy between the House Ways and Means Committee and the New York defendants, which would have strengthened his case for the lawsuit to be heard in Washington. Trump had argued that New York officials were "co-conspirators" with Democrats in Washington, and thus the Washington court had jurisdiction.

"But nowhere in his Amended Complaint does Mr. Trump allege the existence of a conspiracy; in fact, the word 'conspiracy' does not even appear in his pleadings," Nichols wrote.

Soon after, Trump's personal attorney Jay Sekulow said the president's lawyers "are reviewing the opinion."

"The case against the Ways and Means Committee proceeds in federal court," he added in a statement.

James said in a statement that her office is "pleased with the court's conclusion."

"We have never doubted that this law was legal, which is why we vigorously defended it from the start and will continue to do so," she said.

In his lawsuit, Trump's attorneys argued that the state law was simply an effort to get information about his personal finances to embarrass him politically. It asked the court to provide a declaratory judgment that the House Ways and Means Committee "lacks a legitimate legislative purpose for obtaining the President's state tax information."

The New York law, called the TRUST Act, was signed into law in July and allows the chairmen of three congressional tax-related committees — the House Ways and Means Committee, Senate Finance Committee and Joint Committee on Taxation — to request the state returns of public officials only after efforts to gain access to federal tax filings through the Treasury Department have failed. Neal is the only Democrat who can use the law, which was written broadly and makes it easier for New York to turn over the state tax returns of certain public officials to Congress.

"The dismissal of the President’s frivolous lawsuit against the New York TRUST Act moves us closer to finding what it is he has fought so hard to hide from the public," Democratic New York Assemblyman David Buchwald, who sponsored the legislation, said in a statement.

The legislation states that any "legitimate task" of Congress is a valid reason to make the request, should efforts to obtain the returns at the federal level be stonewalled by the Treasury Department. New York state tax filings are not identical to the federal returns, but contain much of the same information.

Neal's committee is tied up in separate legislation over Trump's tax returns with the Treasury Department, which has refused to provide Trump's federal returns to the panel. Neal sued the IRS and the Treasury Department over the returns citing a section of tax law that states the Treasury secretary "shall furnish" to congressional tax committees "any return or return information" request by its chairman.

The stated purpose of Neal's request is to review the IRS process for auditing presidential returns.

When asked about the New York law in June, Neal said utilizing it could harm his case involving Trump's federal returns. In July, Neal said House counsel was "reviewing" the New York law and had "some legitimate concerns" regarding it.

Trump is engaged in several legal battles across the country to keep his tax returns private. Last week, a federal appeals court ruled in a separate case that his returns must be turned over to Manhattan District Attorney Cyrus Vance, who had subpoenaed the documents from Trump's accounting firm as part of an investigation into the pre-election payoffs to two women who alleged affairs with Trump. Trump is appealing that decision to the Supreme Court.

Trump broke with four decades of tradition when he refused to release his returns during his presidential bid, citing an IRS audit — one he now undergoes annually as president. However, such an audit would not preclude him from releasing the returns, which he did pledge to make public during his 2016 run.