The Trump administration notched an early victory in the leadership battle at the Consumer Financial Protection Bureau on Tuesday when a federal judge ruled that Mick Mulvaney, currently the director of the Office of Management and Budget, could serve as acting director of the agency.

The judge refused the request of Leandra English — the CFPB’s deputy director, who is also claiming the right to be acting director of the watchdog agency — to block Mulvaney’s appointment.

The Trump victory could be temporary. US District Judge Timothy J. Kelly, a Trump appointee confirmed in September, said that the case required further review but that Mulvaney may serve while it makes its way through the courts. Nevertheless, English is expected to seek an injunction on this order, the Washington Post reports.

The judge’s ruling is the latest, but likely not the last, chapter in a saga that began after employees at the Consumer Financial Protection Bureau returned to work after the holiday weekend and were met with a bizarre and unconventional scenario: Two people claiming to be their boss.

Director Richard Cordray, appointed by President Obama as the first person to run the agency, resigned effective Friday. That kicked off a battle over who was in charge in the wake of Cordray’s exit. Trump appointed Mulvaney, an avowed opponent of the agency. But before leaving, Cordray designated English to fill his spot until a permanent replacement is nominated and confirmed.

The standoff at the heart of this federal lawsuit is part of a long politicized battle over the bureau’s direction — and even its existence — since its 2011 inception.

Originally proposed by now-Sen. Elizabeth Warren (D-MA) and created under Dodd-Frank financial reform, the CFPB seeks to protect consumers by making consumer finance rules more effective, enforcing those rules, and keeping consumers informed. Its jurisdiction includes banks, credit cards, payday lenders, mortgage lenders, and debt collectors, among others.

It has created new rules governing the mortgage industry — such as an ability-to-repay rule that requires lenders make sure their customers can pay them back, to safeguard against a repeat of the financial crisis — and has put in place protections for prepaid account consumers, including limitations on losses and free access to account information. It has also launched a “Know Before You Owe” initiative to make information about financial products and services more understandable and easily available to consumers.

The CFPB has for years been a partisan flashpoint. It took years of political wrangling to even confirm Cordray in 2013. Republicans have long sought to kneecap the bureau or abolish it altogether.

Mulvaney, a former South Carolina representative, in a 2014 interview slammed the CFPB as a “sick, sad” joke; he also co-sponsored legislation that would have eliminated it. Time noted in May that the Trump White House’s 2018 budget request to Congress included a plan to essentially kill the CFPB, and the president called the bureau a “total disaster” in a tweet over the weekend.

The Consumer Financial Protection Bureau, or CFPB, has been a total disaster as run by the previous Administrations pick. Financial Institutions have been devastated and unable to properly serve the public. We will bring it back to life! — Donald J. Trump (@realDonaldTrump) November 25, 2017

Progressives say the CFPB has played a key role in protecting and informing consumers in the wake of the financial crisis. Under Cordray, the CFPB’s first director, the bureau has, by its own tally, handled more than 1.2 million consumer complaints and brought about nearly $12 billion in relief for harmed consumers.

Mulvaney versus English, explained

Cordray on Friday submitted a letter to the president announcing his decision to resign as director of the CFPB at midnight. He had already telegraphed the decision in a November 15 letter to CFPB employees.

Also on Friday, the CFPB named English, previously the agency’s chief of staff, as deputy director of the CFPB, replacing David Silberman, who had been serving as acting deputy director. Under Dodd-Frank, the deputy director of the CFPB becomes acting director in the absence of a Senate-confirmed director. Until the Senate confirmed a replacement, English would be in charge.

The Trump administration had other plans. Trump announced that he would designate Mulvaney to the interim CFPB spot, arguing that a law generally empowering the president to fill interim vacancies unless federal law requires another replacement process gave him the legal authority to do so.

Mulvaney reported to work on Monday, apparently with doughnuts.

Mulvaney brings donuts to his first day at CFPB. Couldn’t hurt. pic.twitter.com/BpKJ2nd1L0 — Katie Rogers (@katierogers) November 27, 2017

English showed up to work too — and called herself the acting director. She met with Senate Minority Leader Chuck Schumer and Sen. Warren on Monday as well.

This morning in @CFPB



—7:56 am Mulvaney spokesman tweets photo of him “hard at work”



—7:57am, Leandra English sends staff a welcome back email signed “acting director”



—Around 10am, Mulvaney sends staff a memo saying disregard instructions from English.



—Lawsuit in progress. — Tom Namako (@TomNamako) November 27, 2017

The legal argument

Beyond the battle over at least the temporary future of the CFPB lies a legal question: Which federal law decides who will lead the CFPB — the Federal Vacancies Reform Act, which gives the president the ability to fill many open positions in the executive branch, or the Dodd-Frank financial reform that created the bureau in the first place?

Dodd-Frank provides that the agency’s deputy director will serve as acting director in the Senate-confirmed director’s absence. Sen. Warren, a fierce defender of the agency, pointed out the provision on Twitter.

The Dodd-Frank Act is clear: if there is a @CFPB Director vacancy, the Deputy Director becomes Acting Director. @realDonaldTrump can’t override that. pic.twitter.com/r949ccaJAb — Elizabeth Warren (@SenWarren) November 25, 2017

Former Rep. Barney Frank, one of Dodd-Frank’s architects, in an interview with CNN over the weekend supported the assertion that it is Cordray’s right to put English in place in the interim.

“We gave a lot of attention to how to structure the CFPB and how to protect its independence, because its job is to go after some very powerful forces in the economy,” the Massachusetts Democrat said. “The point is, we intend what Cordray was doing to have this kind of autonomy.”

The Trump administration, meanwhile, argues that the vacancy act — which allows the president to appoint temporary officers to executive branch agencies — applies to the CFPB too. The Justice Department released an eight-page memo over the weekend supporting Mulvaney’s appointment.

Mary McLeod, the CFPB general counsel, sided with the department and the White House in a memo published by Politico. So, eventually, did the court, at least temporarily.

Broader questions loom about the CFPB’s future

The acting directorship of the CFPB, though, is a short-term problem as a larger battle over the agency’s next permanent director looms.

President Trump will nominate the CFPB’s next director, who will be subject to Senate confirmation. And given the agency’s history, the fight over who’s next is likely to be a contentious one.

“There is seldom this level of drama in the federal bureaucracy, which multiplies the commentary and conjecture surrounding the situation, but the longer-term leadership realities for the CFPB remain unchanged,” Isaac Boltansky, director of policy research at the Washington, DC-based investment firm Compass Point, said in a Saturday note.

“Beyond the succession [of] sensationalism and constitutional conundrums, the fact remains that President Trump will nominate the next CFPB Director. Under new leadership, the CFPB's rulemaking efforts will grind to a halt and its enforcement agenda will dramatically diminish.”

He added that an ongoing court case, PHH v. CFPB, that is currently before the US Court of Appeals for the District of Columbia could complicate the situation even more. The case deals with the constitutionality of the CFPB’s single-director structure and Dodd-Frank’s provisions that the agency’s director can only be terminated with cause.

If PHH wins, Trump would likely be able to dismiss English if she were running the agency. If the CFPB wins, the case could end up in the Supreme Court.