A federal judge late Monday barred the House Ways and Means Committee from obtaining President Trump’s New York state tax returns under a recently enacted state law without giving the president 14 days’ notice so he can seek the court’s review.

U.S. District Judge Carl J. Nichols of Washington entered the unusual order in a potentially precedent-setting case, which came even though the House committee has not said whether it wants the records and has sought to toss out Trump’s lawsuit, filed last July.

Nichols’s 19-page decision and order came one week after the judge dismissed New York state officials from the lawsuit, which sought to bar the House from requesting and state officials from turning over Trump’s returns using New York’s Trust Act, signed by Gov. Andrew M. Cuomo (D) and enacted July 7.

The law allows New York tax officials to release Trump’s state tax returns to three House committees, provided that the state officials receive requests “in furtherance of a legitimate task of Congress.”

New York tax officials had agreed not to turn over Trump’s records any sooner than seven days after Nichols ruled on whether the Trump lawsuit should be heard before him or before a federal judge in New York.

Nichols concluded the latter on Nov. 11, dismissing the New York defendants and setting the seven-day clock running. Trump attorney William S. Consovoy then asked Nichols to rule on the president’s emergency motion to intervene before any congressional request, arguing that without preemptive action, New York might respond to a sudden House request before the president’s opposition could be heard in court.

Nichols, a Trump appointee who joined the bench in July, sympathized with the president’s argument, ruling Monday that, “absent such relief, [Ways and Means Committee] Chairman [Richard E.] Neal could procure the state tax returns of the sitting President of the United States without any prior notice to the President, or to the Court, that would allow an adjudication of the request’s legality before the dispute become moot.”

Nichols’s one-page order requires that if the committee requests Trump’s state tax returns under the New York law, it notify the court and Trump at the same time. It also orders that Congress “shall not receive any records requested by Chairman Neal for a period of fourteen (14) days, during which time the Court can decide whether Chairman Neal’s request is lawful.”

The House panel has said only that it is continuing to review whether to seek Trump’s state returns.

Spokespeople for House general counsel Douglas N. Letter and House Speaker Nancy Pelosi (D-Calif.) did not immediately respond to a request for comment on Nichols’s opinion, which was issued after 10 p.m.

Letter has urged Nichols to dismiss the case, saying the committee’s decision on whether to use the new state law is “absolutely immune” from court review under the Constitution’s grant of legislative powers to Congress. The House asserts that the Constitution’s speech-or-debate clause generally bars courts from looking into lawmakers’ alleged motives in ruling on the legality of their actions.

“The Supreme Court has repeatedly made clear that courts lack the power to do what Mr. Trump asks,” Letter wrote.

Barring lawmakers from even requesting Trump’s state returns would appear to mark the first time any court overrode Congress’s freedom to conduct legislative work, even before lawmakers have taken any action, Letter said.

“This is of particular concern where the injunction against a body of Congress would be issued at the behest of the President, raising glaring separation of powers concerns. This is precisely what the Framers of the Constitution wished to guard against,” Letter wrote.

New York lawmakers presented the new law as a means of empowering congressional oversight by unearthing details of the president’s past business dealings, his income and other personal financial information that he has refused to release via his federal tax returns.

Trump called the pursuit of his private financial information an attempt at political gain, and accused New York lawmakers of violating his First Amendment rights by trying to discriminate and retaliate against him “for his speech and politics.”