A federal judge in New York ruled Wednesday that two banks that did business with President Trump must comply with congressional subpoenas seeking access to his financial records.

The House Financial Services and Intelligence committees have requested the documents from Deutsche Bank and Capital One to investigate possible “foreign influence in the U.S. political process."

“We remain committed to providing appropriate information to all authorized investigations and will abide by a court order regarding such investigations,” Deutsche Bank said in a statement to Fox News after the ruling.

TRUMP SUES CAPITAL ONE, DEUTSCHE BANK TO KEEP THEM FROM COMPLYING WITH SUBPOENAS

After an hour of oral arguments, U.S. District Judge Edgardo Ramos ruled the subpoenas have "a legitimate legislative purpose” and ruled that Trump was unlikely to prevail in a lawsuit to quash the requests.

Trump’s lawyers had asked the judge to temporarily block Congress from gaining access to the records. They said it was a "safe bet" they would appeal the decision.

CONFIDENTIAL DRAFT IRS TAX MEMO SAYS TAX RETURNS MUST BE HANDED TO CONGRESS UNLESS PRESIDENT USES EXECUTIVE PRIVILEGE: REPORT

"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 said.

“We are pleased with Judge Ramos’ decision. Congress’ authority to conduct relevant oversight has been repeatedly challenged by this Administration,” House Financial Services Committee Chairwoman Maxine Waters, D-Calif., and House Intelligence Committee Chairman Adam Schiff, D-Calif., responded. “The decision made in the U.S. District Court for the Southern District of New York today is a victory for the role of Congress as a co-equal branch of government and for the important work our Committees are doing in protecting and serving the interests of the American public.”

The ruling comes two days after another federal judge in Washington upheld a congressional subpoena seeking financial documents dating back to 2011 from Trump accounting firm Mazars USA. It also comes a day after Trump blocked former White House lawyer Don McGhan from appearing before the House Judiciary Committee.

DEM WANTS TRUMP OFFICIALS JAILED FOR NOT TURNING OVER TAX RETURNS

Lawyers for the Financial Services and House Intelligence committees said Trump’s efforts to block the subpoenas were "flatly inconsistent with nearly a century of Supreme Court precedent,” according to a submission before Wednesday’s hearing.

Some congressional Republicans have called the subpoenas an abuse of authority and blasted the Trump-focused investigations.

Rep. Jim Jordan, R-Ohio, the ranking member of the House Oversight Committee, called the inquiry into Mazars USA "an unprecedented abuse of the Committee’s subpoena authority to target and expose the private financial information of the President of the United States.”

CLICK HERE FOR THE FOX NEWS APP

Trump also has to contend the issue of his tax returns.

State lawmakers in New York approved a measure Wednesday to make those documents available to congressional committees.

Fox News' Lissa Kaplan, Chad Pergram, Gregg Re and The Associated Press contributed to this report.