A federal judge in New York rejected President Donald Trump’s request to keep his banks from producing financial records to lawmakers.

U.S. District Judge Edgardo Ramos, ruling from the bench on Wednesday, said that while the president, his family and his business would suffer irreparable harm from disclosure of the records, they were “unlikely to succeed on the merits” with their argument that the congressional subpoenas are improper.

Ramos, reading his 25-page opinion in a New York courtroom, said he wouldn’t grant Trump’s request for a preliminary injunction.

The Trumps sued Deutsche Bank AG and Capital One Financial Corp. last month to block them from complying with congressional demands for broad financial information. The suit is part of a broader effort by the president to push back at House investigations as he runs for re-election next year.

Congress has the broad authority to investigate matters related to possible legislation, but that doesn’t mean that its powers are limited to probes that involve contemplated bills, Ramos said. He noted that Congress performs many different functions that include looking into corruption, inefficiency or waste in federal government agencies.

“Put simply, the power of Congress to conduct investigations is inherent in the legislative process,” Ramos said.

The banks have taken no position on the legality of the subpoenas and are letting lawyers for the president and the two House panels, the Financial Services and the Intelligence committees, fight it out themselves.

A federal judge in Washington ruled May 20 against a Trump effort to block a subpoena seeking documents from his accounting firm, Mazars USA LLP. Trump is appealing the decision.