As soon as Richard Cordray, the current director of the Consumer Financial Protection Bureau, officially resigns — which could happen as soon as this week — we are told President Donald Trump will choose Mick Mulvaney, the current director of the Office of Management and Budget, to run the CFPB on a temporary basis.

It would be a GOP dream come true. Mulvaney, who once called CFPB a “sad, sick joke,” would then be able to carry out the long-desired conservative wish to dismantle the agency that safeguards consumers from the deceptions of banks and credit card companies.

Practically every media outlet has carried this report about Mulvaney to CFPB. There’s only one problem: it’s not Trump’s pick to make.

That fact, and expected resistance to that fact inside the White House, could create a titanic legal battle, and a scenario with competing interim directors of the agency, which has become a political football ever since Congress created it in 2010. “This will be like the situation where you had two popes,” said Jeff Hauser, executive director of the Revolving Door Project at the Center for Economic and Policy Research.

Adam Levitin, Georgetown Law professor and former CFPB adviser, was the first to point this out. The statute that created the CFPB is pretty clear: In the event of the absence of a director for the agency, the deputy director serves that role. The director appoints the deputy director; it doesn’t require Senate confirmation.

This would mean David Silberman, acting deputy director of CFPB, would get the reins when Cordray leaves office. Silberman is a former AFL-CIO deputy general counsel and a law clerk to Justice Thurgood Marshall who has worked at the CFPB since 2011. The legal argument that Silberman would become interim director would be greatly improved if Cordray officially named him deputy director; he’s been serving in an acting capacity since January 2016.

The effort to install an outside director further brings into focus a growing strategy by the Trump White House to get around the Senate confirmation process by installing loyalists to fill vacancies, instead of the traditional process of allowing deputies from inside the agencies to serve temporarily. Keith Noreika, a former bank lawyer, stepped into the job of acting Comptroller of the Currency, a key bank regulator, and served for six months before the Senate confirmed his replacement last week. David Kautter, an ex-executive with Ernst & Young, became IRS commissioner last month; the Trump administration has not named a nominee to fill the role permanently.

Critics have condemned Trump for sidestepping the Senate and placing cronies in charge to speed up deregulation or advance his personal interests (Trump has an IRS audit, as we know). But while previously this abuse of executive branch vacancies constituted breaking a norm, in the case of the CFPB, it would constitute breaking the law.

The Trump administration has labored under the idea that the Federal Vacancies Reform Act would control any vacancy at the CFPB. Under that law, the president can appoint a Senate-confirmed official, like Mulvaney, to any vacant executive agency leadership position. This temporary appointment lasts for either 210 days or as long as a nomination for a permanent replacement is before the Senate.

But the Federal Vacancies Reform Act statute 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.” And Levitin believes the CFPB’s designation of authority to the deputy director if the director is absent serves that function. “That plain language is an express provision for a different succession,” Levitin wrote.

Matt House, a spokesman for Senate Minority Leader Chuck Schumer, D-N.Y., said that Senate Democrats read the law the same way, that the deputy must become the next acting director. “Yes, that’s our view,” said 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 godmother of the agency. Warren did not respond to a request for comment.

Under this reading, Trump would still get a say in the CFPB by nominating a successor, but only by getting that successor confirmed through the Senate, not with an end-run. The IRS and Office of Comptroller of the Currency did not have the same statutory language, so they didn’t have this same constraint.

“My sense is that it’s the CFPB’s own statute that governs here,” said Nina Mendelson, a professor at the University of Michigan Law School.

Indeed, the legislative intent when creating the CFPB was to shield it from politics and presidential control. Its director can only be fired for specific cause, and its budget is not subject to the appropriations process. In fact, as Levitin explained, the House version of Dodd-Frank, the vehicle for creating the CFPB, did apply the Federal Vacancies Reform Act to absences of a director, but the conference committee stripped that language out, adopting the Senate version. In other words, Congress had the chance to apply the Federal Vacancies Reform Act to the CFPB and actively chose not to.

There’s no guarantee , however, that Trump would allow Silberman to become interim director. He may try to appoint Mulvaney anyway. At this point, you would have two interim directors of the CFPB, with unpredictable outcomes.

Under the law, any action taken by a director that was improperly appointed would have “no force or effect.” But someone with standing would have to sue to block those actions. “Someone who is directly regulated by a rule could challenge it,” said Mendelson. “This could include consumers, but they would have to show they were directly and concretely affected.”

In the meantime, if Silberman stayed in place and Mulvaney also tried to use the director’s authority, it’s completely unclear who would be listened to. If the Federal Register received a change to a regulation from Mulvaney, would they enact it? If Silberman tried to internally direct an enforcement action, would his colleagues abide by it?

Another possibility is that Trump appoints a deputy director, which would technically be a vacant position if Silberman is still acting deputy director by the time Cordray resigns. At that point, the deputy director could serve until the Senate confirms a replacement.

Cordray’s failure at that point to appoint Silberman deputy director would mean Cordray would have opened a huge potential loophole to accelerate the destruction of a major Democratic accomplishment, at a time when he is rumored to be ramping up to run as a Democrat for governor of Ohio. Willingly turning over the CFPB to Trump and Mulvaney, for no other reason than bureaucratic inaction, would mark a rough start to Cordray’s campaign.

The situation is further complicated by a lawsuit between the CFPB and PHH Mortgage, currently under appeal. That lawsuit may give the president the power to fire a CFPB director at will and without cause, which would mean Trump could simply throw out Silberman. The D.C. Court of Appeals re-heard the case in May, and observers believe the CFPB will prevail, eliminating the at-will firing threat.

The path of least resistance would be Trump simply agreeing to Silberman’s temporary status, while nominating a director for quick Senate confirmation. But that could get tricky. By December 12, Republicans may only have a 51-49 majority, if Doug Jones defeats Roy Moore in Alabama. With such a narrow margin, it may be difficult to get a dedicated deregulator through the Senate. Plus, a high-profile fight on an issue so deeply associated with Wall Street could have repercussions in the 2018 midterms.

The more likely outcome is a legal fight, which would not only call into question CFPB actions, but also the actions of the Federal Deposit Insurance Corporation and the Financial Stability Oversight Council, two boards on which the CFPB director serves. In other words, it’d be a huge mess. But it’s definitely not as clearcut as saying Mulvaney can automatically assume the director’s position.

Update: November 21, 2017

This story was updated to include comment from Matt House.