Michael Barr will step down from his role as the Federal Reserve’s vice chair for supervision by Feb. 28, or sooner if President-elect Donald Trump appoints a successor, the Fed said Monday.

Barr will continue to serve on the central bank’s Board of Governors. But in an interview, Barr said the decision to leave his role as vice chair of supervision was intended to sidestep a protracted legal battle with Trump that he believed could damage the central bank.

Some individuals attached to the Trump administration wanted to fire Barr before his term as vice chair expired, according to people familiar with the matter who spoke on background because of the sensitivity of the issue.

That could have resulted in a lengthy — and costly — legal fight over whether an incoming president has the authority to remove someone from a Senate-confirmed position at an independent agency.

Some financial regulatory experts questioned why Barr — and the Fed itself — would allow a political change to influence who served in a powerful role. Jerome Powell, the Fed’s chair, has made a point of saying that the Fed is independent of the White House and that its decisions are not influenced by politics. Powell has also insisted that Trump lacks the legal authority to fire him from his role as Fed chair, which is also confirmed by the Senate.

“I’m surprised by Barr’s announcement, because I expected him to resist Republican calls for his ouster and make a point of defending the Fed’s independence,” Ian Katz, managing director at Capital Alpha, said in an email.

Barr said he and his lawyers believed that he would prevail in court if Trump were to try and remove him. But he concluded that the fight wasn’t worth waging because of the harm it could inflict on the Fed.

“If it came to litigation on the merits, I would win,” Barr said. The bigger question, he said, was, “Do I want to spend the next couple of years fighting about that and is that good for the Fed? And what I decided was that no, it’s not good for the Fed; it would be a serious distraction from our ability to serve our mission.”

Barr said the decision was not easy. “The question I wrestled with is a tough question, and in many ways it was a painful decision.”

His departure will effectively freeze any bank regulatory actions until Trump names someone to the vice chair role. In announcing his move, the central bank said: “The Board does not intend to take up any major rulemakings until a vice chair for supervision successor is confirmed.”

The combination of Barr’s decision to step down and the moratorium struck some financial regulatory experts as especially problematic.

“The Fed historically, zealously guards its independence,” said Aaron Klein, the Miriam K. Carliner chair and senior fellow in economic studies at the Brookings Institution. “I find it strange that the Fed would not only tacitly seem to support this decision by Barr, but go further and announce a moratorium on rulemaking.”

Klein noted that if Trump opted not to pick anyone for a year or more, it could effectively chill bank rulemaking indefinitely.

Dennis Kelleher, president, CEO and co-founder of Better Markets, a nonprofit that pushes for tougher financial regulation, called Barr’s decision “shocking” and said it would hinder the Fed’s role in overseeing the safety and soundness of the financial system.

“His baseless capitulation to deregulation zealots will, in fact, destroy that mission quicker and more thoroughly than any dispute over the position,” he said.

Barr’s move comes after a tumultuous tenure overseeing regulation and supervision of the nation’s largest banks. Barr oversaw an attempt to rewrite financial rules that would have increased the amount of money that banks must have at the ready.

The overhaul would have required the largest banks to increase their cushion of capital — cash and other easily accessible assets that could be used to absorb losses — which Barr said would ensure banks could withstand periods of severe turmoil.

The proposal — and Barr — immediately came under attack from a wide variety of groups, including the banking industry, lawmakers and even some of his colleagues at the Fed.

Barr ultimately watered down the proposal in September after acknowledging the blowback.