Signaling an epic fight over control of the Consumer Financial Protection Bureau, the agency on Friday named Leandra English as deputy director. English had been serving as CFPB Director Richard Cordray’s chief of staff.

Hours later, Cordray officially resigned. Under the statutory line of succession spelled out in the law that created the agency, the deputy director automatically replaces him, with full powers of the office, until the Senate formally confirms a new director selected by the president.

President Donald Trump had planned to name Mick Mulvaney, current director of the Office of Management and Budget, as interim director, wresting immediate control of CFPB without having to go through Congress. The administration would have relied on the Federal Vacancies Reform Act, which allows the president to make appointments to federal agencies in certain cases. But as The Intercept reported earlier this week, there was a hitch in that plan: The temporary pick is not legally Trump’s to make. (See the update below: Trump made the pick regardless late on Friday evening.)

The appointment of English, just moments before Cordray’s departure, suggests that CFPB will make the case that Trump can’t appoint anyone on an interim basis, and that only the deputy director can replace an absent or unavailable director. The FVRA states specifically that it doesn’t apply to agencies where “a statutory provision … designates an officer or employee to perform the functions and duties of a specified office temporarily in an acting capacity.”

If Trump decides to appoint Mulvaney or another interim director anyway, it could set up a titanic battle, with effectively two different people claiming leadership of the agency — one who expressly opposes its mission and one who supports it. The courts would have to sort out the aftermath, determining whether Trump’s appointee or deputy director English hold actual control.

In recent days, top Democrats like Senate Minority Leader Chuck Schumer, D-N.Y., had agreed that the deputy director would serve as acting director in Cordray’s absence. “Yes, that’s our view,” said Schumer spokesperson Matt House, “and we’ve been in conversations with the offices of Sens. Brown and Warren on exploring ways to ensure the line of succession, as drawn up in law, is adhered to.” Sherrod Brown is the top-ranking Democrat on the Senate Banking Committee, while Sen. Elizabeth Warren, D-Mass., was the intellectual author of the agency prior to becoming a senator. She was also named by former President Barack Obama to set up the agency on a temporary basis before Cordray was confirmed.

The deputy director position had been vacant since January 2016. David Silberman, the CFPB’s associate director of Research, Markets, and Regulations, was serving in an acting capacity. Some Democrats and advocates had expressed concern that CFPB’s legal argument was not as strong with an acting deputy director as with one named by Cordray. With Friday’s decision — in the ultimate news-dump position of the day after Thanksgiving — Cordray has strengthened CFPB’s case on his way out the door. Silberman will stay in his associate director position.

Cordray even referenced the statute that gives him authority in his announcement:

Accordingly, upon my departure, [English] will become the acting Director pursuant to section 1011(b)(5) of the Dodd-Frank Act. In considering how to ensure an orderly succession for this independent agency, I determined that it would be best to avoid leaving this key position filled only in an acting capacity. In consultation over the past few days, I have also come to recognize that appointing the current chief of staff to the deputy director position would minimize operational disruption and provide for a smooth transition given her operational expertise.

Corporate lobbyists are already out in force objecting to Cordray’s action. “The decision to choose who leads the country’s consumer protection agency, and confusion that’s been caused by Cordray’s own ‘succession plan,’ should not be made by one individual,” said Chris Stinebart, president and CEO of the American Financial Services Association, “and for this reason AFSA has long advocated for a bipartisan commission.”

Of course, the succession plan isn’t Cordray’s, it’s part of the statute passed by Congress. And the one individual seeking to choose CFPB leadership is Trump, who has installed acting heads of both the Office of Comptroller of the Currency and the IRS, seeding those agencies with loyalists immediately following a vacancy without having to wait for Senate confirmation of a replacement. Trump could still try to do the same with CFPB, but he would have to fight against a legal argument that the independent agency has its own line of succession. There’s no reason to officially name a deputy director right now unless the agency plans to take up that fight.

English is a career bureaucrat, having worked at the Office of Personnel Management and Office of Management and Budget before CFPB. She has worked at CFPB from its inception in 2010, first serving on the implementation team led by Warren at the Treasury Department. Later she rose to become deputy chief operating officer, acting chief of staff, deputy chief of staff, and chief of staff. “Leandra is a seasoned professional who has spent her career of public service focused on promoting smooth and efficient operations,” said Cordray in a statement. “As deputy director, we will continue to benefit from Leandra’s in-depth knowledge of the operational needs of this agency and its staff.”

Cordray was the first director of CFPB, beginning after a recess appointment in January 2012. He didn’t get confirmed by the Senate until July 2013. His five-year term was going to be up next July. Cordray is expected to run for governor of Ohio. Under his leadership, CFPB recovered nearly $12 billion for consumers and issued a host of consumer protection rules.

Update: Nov. 24, 2017

On Friday evening, several hours after Cordray’s announcement, the White House released a statement confirming it plans to wage a battle over succession, ushering in the CFPB’s era of two popes:

Today, the President announced that he is designating Director of the Office of Management and Budget (OMB) Mick Mulvaney as Acting Director of the Consumer Financial Protection Bureau (CFPB). The President looks forward to seeing Director Mulvaney take a common sense approach to leading the CFPB’s dedicated staff, an approach that will empower consumers to make their own financial decisions and facilitate investment in our communities. Director Mulvaney will serve as Acting Director until a permanent director is nominated and confirmed.

Correction: Nov. 26, 2017

This story originally referred to Chuck Schumer as Senate majority leader. He is the minority leader.

Top photo: Director of Consumer Financial Protection Bureau Richard Cordray testifies during a hearing before the House Financial Services Committee in September 2013 on Capitol Hill in Washington.