WASHINGTON — President Trump’s accounting firm must comply with House Democrats’ demands for eight years of his financial records, a federal appeals court panel ruled Friday in a major victory for House Democrats in their struggle against his vow to stonewall “all” of their oversight subpoenas.

In a 66-page ruling, the panel rejected Trump’s argument that Congress had no legitimate legislative authority to seek his business records from the firm, Mazars USA, because the committee was trying to determine whether he broke existing laws — not weighing whether to enact a new one.

“Having considered the weighty issues at stake in this case, we conclude that the subpoena issued by the committee to Mazars is valid and enforceable,” wrote Judge David S. Tatel of the U.S. Court of Appeals for the District of Columbia.

Trump is virtually certain to appeal the ruling, either to the full Court of Appeals or to the Supreme Court. But the decision — affirming an earlier ruling by a U.S. District Court judge — was the first test at the appeals court level of the Trump legal team’s sweeping challenges to the constitutional authority of Congress to conduct oversight of his activities.

Tatel was joined by Judge Patricia A. Millett in the majority of the three-judge ruling. Both were appointed by Democratic presidents.

Judge Neomi Rao, a former Trump administration official whom Trump appointed to the bench in March, dissented, saying she would have quashed the subpoena as exceeding the House’s legislative powers.

Rep. Elijah E. Cummings, D-Md., chairman of the oversight committee, hailed the appeals court’s decision.

“Today’s ruling is a fundamental and resounding victory for congressional oversight, our constitutional system of checks and balances and the rule of law,” he said in a statement. “For far too long, the president has placed his personal interests over the interests of the American people.”

The scope of Congress’ power to compel the production of information — and the president’s power to keep information secret — has emerged as a recurring battleground between House Democrats and Trump.

This week, Trump’s White House counsel, Pat Cipollone, sent a letter to the House declaring that the administration would not cooperate with the House’s impeachment inquiry, such as by providing documents or permitting witnesses to testify.

The Trump legal team has separately argued that Trump’s current and former White House aides are absolutely immune from subpoenas for their testimony — meaning they would not even have to show up — and that Congress lacks legitimate legislative authority to scrutinize potential wrongdoing in the executive branch.

Cummings, issued the subpoena after it came to light that Trump had failed to list on his ethics disclosure forms a debt that he owed and then repaid to his former lawyer and fixer, Michael Cohen, for paying hush money to a pornographic actress just before the 2016 election to keep quiet about an affair she claimed to have had with Trump.

Charlie Savage is a New York Times writer.5