A federal judge dismissed Donald Trump’s lawsuit to block the Manhattan district attorney from obtaining the president’s personal and corporate tax returns from his accountants as part of a criminal investigation, and those records would have been made available to them today.

However, less than two hours later, the Trump legal team won a delay to postpone today’s 1 p.m. deadline for his accounting firm, Mazars USA, to turn the documents over in a fight that is likely to end up before the Supreme Court.

The office of DA Cyrus Vance Jr. is investigating whether or not the Trump Organization violated campaign finance laws by falsifying records related to hush-money payments to two women who claim to have had an affair with Trump, Stephanie Clifford, aka Stormy Daniels, and Karen McDougal, ahead of the 2016 election.

Trump’s lawyers argued that the U.S. Constitution protects him from criminal investigation because he is the president.

The judge, Victor Marrero, rejected and lambasted the “extraordinary claim” by Trump’s legal team that he can’t be investigated and is immune from criminal prosecution while he is president, a claim the judge called “repugnant to the nation’s governmental structure and constitutional values.”

Marrero said under the Trump legal team’s theory, the president’s behavior would be immune from any investigation, as well as the suspected “misconduct of any other person, business affiliate, associate or relative who may have collaborated with the President in committing purportedly unlawful acts.”

“This court cannot endorse such a categorical and limitless assertion of presidential immunity,” Marrero wrote in his ruling. “The expansive notion of constitutional immunity invoked here to shield the president from judicial process would constitute an overreach of executive power.”

Lawyers from the DA’s office, which has requested eight years of Trump’s tax returns, told Marrero they will keep the financial documents secret.

Trump also is suing to protect his tax returns from a House Ways and Means Committee probe, and fighting two more subpoenas from two other House committees that are trying to get his financial information from Mazars, Deutsche Bank and Capital One Financial Corp.