U.S. District Judge Edgardo Ramos, an Obama appointee, made the ruling in a New York courthouse Wednesday afternoon after hearing arguments from both parties in the case.

The ruling is the second setback for the president this week in his fight to stop lawmakers from gaining access to his financial records as part of their sweeping probes into him, his administration, his private businesses and his family.

Trump, his businesses and family members had argued for the federal court in New York to issue a preliminary injunction to block the subpoenas for documents.

Trump's lawyers have promised to appeal any ruling not in their favor.

Trump's lawyers also argued that the document requests were beyond the bounds of Congress's authorities, claiming that lawmakers had to have a specific legislative purpose in requesting the documents. And they alleged that Democrats in Congress were solely acting to dredge up damaging information relating to the president ahead of the 2020 election

Lawyers for House Democrats pushed back against that claim. They argued in court filings that Congress was conducting "legitimate" investigations and that Trump and his businesses "have continually engaged in stonewalling intended to obstruct and undermine these inquiries."

Wednesday's ruling is the second blow this week to the president in his legal war against House Democrats after a federal judge in D.C. ruled Monday that Trump accounting firm Mazars could hand over requested financial records to the House Oversight and Reform Committee. Trump's attorneys have appealed that ruling to the D.C. Circuit Court of Appeals.

Some House Democrats have pointed to the legal victories to argue that starting an impeachment inquiry against Trump is not necessary in order to hold him accountable. And others have said it's a sign they will win in other battles with the administration, such as the push to obtain Trump's tax returns.

Still, Trump's lawyers are likely to appeal the latest ruling as well. And with major political implications at hand, judges are likely to be cautious in issuing their rulings, meaning the legal battle could drag out over the coming weeks and months.

Some legal experts have predicted that the fight could go all the way up the court system to the Supreme Court. The justices are expected to wrap up their term by the end of June.