WASHINGTON (CN) – Backing the independence of the Consumer Financial Protection Bureau, the D.C. Circuit ruled 7-3 Wednesday that leaders of the agency are protected “from at-will removal by the president.”

Federal law governing the bureau, which only came into existence following the 2008 financial crisis, sets strict parameters on removing the agency’s director prior to completion of a five year term. The law says such a removal can be done by the president, but only for “inefficiency, neglect of duty, or malfeasance in office.”

The mortgage lender PHH Corp. brought a constitutional challenge to dismantle the bureau after it was hit in 2014 with a $109 million disgorgement order.

PHH complained that providing for-cause protection to the sole director of an independent agency encroaches on the president’s power, but a majority of the en banc court determined Wednesday that this structure has precedent.

The CFPB may be a new agency, but the D.C. Circuit likened its powers to that of the Federal Trade Commission, whose independence the Supreme Court upheld in the 1935 case Humphrey’s Executor v. United States.

“We follow that precedent here to hold that the parallel provision of the Dodd-Frank Wall Street Reform and Consumer Protection Act shielding the Director of the CFPB from removal without cause is consistent with Article II,” U.S. Circuit Judge Cornelia Pillard wrote for the majority.

While the lead opinion by Pillard clocks in at 68 pages, three separate concurring opinions and another three dissents take the ruling’s total page count to 250.

PHH failed to sway the majority that the Humphrey precedent was a narrow exception to a general prohibition on removal restrictions, one PHH simultaneously argued does not apply to agencies with multimember leadership, like the Federal Trade Commission, because they have internal checks to prevent arbitrary decision-making.

Pillard called that constitutional distinction “untenable.”

“That distinction finds no footing in precedent, historical practice, constitutional principle, or the logic of presidential removal power,” she wrote. “The relevance of ‘internal checks’ as a substitute for at-will removal by the president is no part of the removal-power doctrine, which focuses on executive control and accountability to the public, not the competing virtues of various internal agency design choices.”

Pillard’s ruling deals a blow to the Trump administration, whose Justice Department met the decision with noted disappointment today.

When the bureau’s first director, Richard Cordray, resigned this past November, just months his five-year term was set to expire, Trump thwarted an attempt by Cordray to hand the agency’s reigns to his deputy, Leandra English.

Trump has been successful so far in fending off challenges to his appointee, White House budget director Mick Mulvaney.

Republicans in Congress have long lambasted the CFPB, in part because the director is protected from removal barring misconduct.

A representative for the Consumer Financial Protection Bureau said the agency is “analyzing the decision.”

Though Wednesday’s ruling rejects PHH’s constitutional challenge, it reinstates an earlier ruling by a panel of the D.C. Circuit, which vacated the disgorgement order against PHH.

The mortgage lender called this “an important and gratifying outcome for PHH and the industry.”

“We continue to believe that we complied with RESPA and other laws applicable to our former mortgage reinsurance activities in all respects,” PHH said, using an abbreviation for the Real Estate Settlement Procedures Act of 1974.

The bureau could still defend its disgorgement action against PHH on remand. PHH said it “will continue to present, if necessary, the facts and evidence to support our position that mortgage insurers did not pay more than reasonable market value to PHH affiliated reinsurers.”