The hearing came two days after a federal judge ruled against Trump's attempt to block a House subpoena for some of his financial information.

NEW YORK — A New York judge refused Wednesday to block congressional subpoenas seeking financial records from two banks that did business with President Donald Trump, making it clear it wasn't a close call.

U.S. District Judge Edgardo Ramos said in a ruling delivered from the bench that Trump and his company were "highly unlikely" to succeed in a lawsuit arguing that the subpoenas seeking records from Deutsche Bank and Capital One were unlawful and unconstitutional.

Ramos also concluded that the subpoenas have "a legitimate legislative purpose" and dismissed one-by-one arguments made to try to bury them, though he conceded that records released publicly could cause Trump and his family irreparable harm.

The lawyers for the House Financial Services and Intelligence committees say they need access to documents from the banks to investigate possible "foreign influence in the U.S. political process" and possible money laundering from abroad.

Deutsche Bank has lent Trump's real estate company millions of dollars over the years.

When Ramos finished reading aloud a lengthy ruling, he asked Trump's lawyer, Patrick Strawbridge, if he would appeal.

"That's probably a safe bet," Strawbridge responded.

The judge then noted that both sides had agreed that the subpoenas would not require a response for another week, giving Trump, his family and his companies time to appeal.

The hearing falls two days after a federal judge in Washington ruled against Trump in a similar case, finding that the president cannot block a House subpoena for information from a financial services firm that had done accounting work for him and the Trump Organization.

And it comes a day after Trump blocked his former White House lawyer, Don McGahn, from testifying before the House Judiciary Committee.

In a written submission prior to Wednesday's hearing, lawyers for two congressional committees wrote that Trump's effort to block the subpoenas was "flatly inconsistent with nearly a century of Supreme Court precedent."

Attorney Douglas Letter cited some of those rulings when he argued before Ramos on Wednesday that Trump should not be able to block "a very major complex investigation across a whole industry, not just Mr. Trump."

He said there were about 10 subpoenas sent to individuals or entities that have "nothing to do with Mr. Trump."

Letter said there is a "massive fundamental misunderstanding by Mr. Trump about Congress ... that we're a nuisance and we can't investigate him."

In court papers, lawyers said the House's Committee on Financial Services and Permanent Select Committee on Intelligence sought the information as they investigate "serious and urgent questions concerning the safety of banking practices, money laundering in the financial sector, foreign influence in the U.S. political process, and the threat of foreign financial leverage, including over the president, his family and his business."

Lawyers for Trump responded in writing that accepting the view of the committees would mean "Congress can issue a subpoena on any matter, at any time, for any reason, to any person, and there is basically nothing a federal court can do about it."

Trump's lawyers had asked the judge to temporarily block Congress from obtaining the records.

The banks took no position in the dispute.