A federal judge in New York ruled Wednesday that Deutsche Bank and Capital One can hand over President Donald Trump’s financial records in relation to a subpoena issued by House Democrats.

Judge Edgardo Ramos’s decision followed a hearing attended by attorneys for President Trump’s children and the Trump Organization in which they argued why the document request should be denied, according to CNBC. Ramos also concluded that the subpoenas have “a legitimate legislative purpose.”

The lawyers for the House Financial Services and Intelligence committees said they need access to documents from the banks to investigate possible “foreign influence in the U.S. political process.”

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

The ruling follows a similar decision two days prior which allows Mazars LLP, the president’s accounting firm, to comply with the House Oversight Committee’s document request. House oversight panel chair Rep. Elijah Cummings’ (D-MD) wrote Mazars on March 20 requesting information on how those financial statements and other disclosure documents were prepared. Reps. Mark Meadows (R-NC) and Jim Jordan (R-OH) criticized the request, slamming it a waste of government resources. “We should not waste our limited resources and energies on matters that do not improve the operations of the federal government or better the lives of our constituents,” the pair of Republican lawmakers wrote in a recent letter to Cummings, describing the inquiry “an ill-conceived inquiry into the finances of President Trump when he was a private citizen.”

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

The lawyers said the House’s Committee on Financial Services and Permanent Select Committee on Intelligence sought the information as it investigates “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 President 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.

The Associated Press contributed to this report.