A federal appeals court ruled Wednesday the Consumer Financial Protection Bureau's single-director structure is constitutional, reversing an earlier federal decision that the Obama-era agency fell afoul of the separation of powers.

The full D.C. Circuit Court of Appeals ruled seven to three that the current structure of the agency, which allows for a single director who cannot be removed by the president except for cause, "is consistent with Article II" of the Constitution.

The opinion for the majority was written by Cornelia Pillard, an Obama appointee, who argued that the Supreme Court already approved the structure of the CFPB in a 1935 case relating to the Federal Trade Commission, which also is an independent agency with a director who can't be fired at will.

The majority were all Democratic appointees, with the exception of George W. Bush appointee Thomas Griffith, who wrote a concurring opinion on much narrower grounds. The original three-judge panel that found the bureau's structure unconstitutional in 2016, all Republican appointees, dissented.

The case was first brought against the CFPB by a lender, PHH Mortgage Corp., that had been fined by the bureau and sued it as unconstitutional.

Republicans have criticized the bureau as unaccountable on the logic that its director isn't answerable to the executive branch, given that the director gets a five-year term and cannot be fired at will, or to the legislature, since it gets its funding from the Federal Reserve rather than from Congress.

PHH also argued that the bureau is less accountable than other independent agencies because it features a single director rather than a bipartisan board. Pillard, however, wrote that that distinction is "untenable."

The logic employed in the case against the bureau's single-director structure would "broadly transform modern government" if applied to other agencies, Pillard wrote.

"While the Court ruled the CFPB’s governing structure was not unconstitutional, it does not mean the current structure is appropriate for the Bureau’s long-term credibility," said Richard Hunt, head of the Consumer Bankers Association. Hunt called for Congress to impose a bipartisan commission structure on the agency.

One dissenting judge, Karen Henderson, argued that the "administrative agencies sprawled across Washington, D.C.—especially the 'independent' ones—do not fit comfortably within the text and structure of the Constitution."

Wednesday's provided a victory for liberal advocates of the bureau. "This isn’t just a victory for the Consumer Financial Protection Bureau, this is a victory for consumers everywhere," said Karl Frisch, executive director of the group Allied Progress. "The D.C. Circuit has soundly rejected attempts by Wall Street special interests to cripple the Bureau by challenging its constitutionality."

Currently, the CFPB's leadership is the center of a separate controversy. Mick Mulvaney, the White House Office of Management and Budget director, is serving as the acting director, having been appointed by President Trump. But Democrats recognize Leandra English as the acting director, on the grounds that the law provided for a different mechanism for establishing the acting director in a vacancy. That controversy is also currently under review in federal court.

The vacancy was created when Richard Cordray, the Obama appointee who first led the bureau, left to pursue a bid for Ohio's governorship as a Democrat.

Cordray tweeted about the case from the campaign trail, saying that "today's decision is all about maintaining independent law enforcement free from politics."