The Consumer Financial Protection Bureau’s director can be fired by the president only for cause, a federal appeals court ruled on Wednesday, restoring security to a job that has become a political lightning rod.

When Congress created the bureau seven years ago, it specified that the director — after being nominated to a five-year term by the president and confirmed by the Senate — could be removed only for “inefficiency, neglect of duty or malfeasance.” That standard differs from those in effect at most other federal agencies, whose leaders can typically be removed at will by a president.

Last year, a three-judge panel of the United States Court of Appeals for the District of Columbia Circuit found the bureau’s setup to be unconstitutional. On Wednesday, the full circuit court issued a ruling that vacated the earlier decision and upheld the constitutionality of the consumer bureau’s structure.

There is “no constitutional defect” in the unusual independence that lawmakers granted to the bureau’s director, the ruling issued on Wednesday said. The court added: “Congress’s decision to provide the C.F.P.B. director a degree of insulation reflects its permissible judgment that civil regulation of consumer financial protection should be kept one step removed from political winds and presidential will.”