The Supreme Court on Monday made it easier for the president to remove the Consumer Financial Protection Bureau’s director but allowed the watchdog agency created after the global financial crisis to stand.

In a divided decision, the court said the agency’s structure violates the Constitution’s separation-of-powers design.

Its single-director configuration concentrates “significant governmental power in the hands of a single individual accountable to no one,” wrote Chief Justice John G. Roberts Jr., who was joined in part by the court’s other conservative justices. “. . . With no colleagues to persuade, and no boss or electorate looking over her shoulder, the Director may dictate and enforce policy for a vital segment of the economy affecting millions of Americans.”

The independent regulatory agency was the brainchild of now-Sen. Elizabeth Warren (D-Mass.) when she was a Harvard University law professor. It was part of 2010’s financial overhaul bill, the Dodd-Frank Wall Street Reform and Consumer Protection Act, passed in response to the financial crisis. The agency has been a target of conservatives who have criticized it for acting too aggressively.

The Trump administration backed the challenge, arguing that the president should be free to fire the bureau’s director.

In its 5-to-4 ruling Monday, the court majority said the structure of the investigative and enforcement agency violates the Constitution by “concentrating power in a unilateral actor insulated from Presidential control,” wrote Roberts, who was joined by Justices Clarence Thomas, Samuel A. Alito Jr., Neil M. Gorsuch and Brett M. Kavanaugh.

Roberts, Alito and Kavanaugh agreed that provisions in the law restricting the director’s removal could be struck while allowing the agency to continue to operate.

“We think it clear that Congress would prefer that we use a scalpel rather than a bulldozer in curing the constitutional defect we identify today,” Roberts wrote.

Justice Elena Kagan, writing for the court’s liberals, said Congress should have the flexibility to impose limits on the president’s power to get rid of agency heads. She faulted the majority for second-guessing Congress, which created the agency to “address financial practices that had brought on a devastating recession, and could do so again.”

“Today’s decision wipes out a feature of that agency its creators thought fundamental to its mission — a measure of independence from political pressure,” Kagan wrote in her dissent.

The agency’s director, Kathy Kraninger, said the decision “brings certainty to the operations of the Bureau.”

“We will continue with our important mission of protecting consumers with no question that we are fully accountable to the President,” Kraninger tweeted.

After the bureau’s original director stepped down in 2017, President Trump appointed Mick Mulvaney, who as a South Carolina lawmaker called the CFPB a “joke” and co-sponsored legislation to get rid of it. Mulvaney, who later served Trump as the White House chief of staff, began to transform the watchdog, levying fewer and smaller fines, dropping lawsuits against payday lenders, and softening proposed regulations for debt collectors while he was acting director.

White House press secretary Kayleigh McEnany hailed the ruling as a victory and said in a statement that the president “believes that no official should hold such immense powers without, at least, being directly accountable to a democratically-elected President regardless of party affiliation.”

In response to the ruling, Warren tweeted that the decision hands “more power to Wall Street’s army of lawyers and lobbyists to push out a director who fights for the American people.”

The decision was also criticized by the banking industry, which has called for the CFPB’s single director to be replaced by a bipartisan commission.

Leaving the CFPB with an at-will director will further exacerbate the “political influence that has already plagued” it, Richard Hunt, president of the Consumer Bankers Association, said in a statement. “This outcome subjects consumers and the financial services industry to potentially radical regulatory shifts with each administration.”

Congress gave the agency broad powers to implement and enforce consumer protection laws. The bureau has been headed by a single director, nominated by the president and confirmed by the Senate for a five-year term. The director could only be removed by the president for “inefficiency, neglect of duty, or malfeasance in office,” unlike, say, Cabinet officers, who serve at the president’s pleasure.

But the challengers said the Constitution gives the president the power to remove top executive branch officials for any reason or no reason at all.

Although the removal-for-cause protection applies to other agencies, such as the Securities and Exchange Commission and the Federal Reserve Board, they have multiple-member boards, rather than a single director.

The case was brought in 2017 by a California law firm that objected to the CFPB’s demand for information regarding an investigation of its practices in resolving consumer debt.

The case is Seila Law v. Consumer Financial Protection Bureau.

Robert Barnes contributed to this report.