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 demands by congressional Democrats 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.

After Ramos issued his ruling, Trump’s lawyers asked for a stay to delay its implementation. That request was rejected. Patrick Strawbridge, a lawyer for Trump, said it was “probably a safe bet” that the president would appeal the ruling.

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.

“I am very pleased but not surprised” by the latest ruling, said Representative Elijah Cummings, chairman of the Oversight Committee.

The Oversight Committee wasn’t one of the panels seeking the bank records. But Cummings said that the two rulings together solidify Congress’s right to these documents.

The case is Trump v. Deutsche Bank AG, 19-cv-03826, U.S. District Court, Southern District of New York (Manhattan).