Washington staged a collective freakout Monday as Deputy Attorney General Rod Rosenstein, the official responsible for safeguarding special counsel Robert Mueller’s Russia investigation, travelled to the White House to reportedly hand in his resignation.

But after letting the chaos consume D.C. for hours, the White House finally stepped in, making clear that Rosenstein still had a job, at least until Thursday, when he’ll meet with Trump in person at the White House.

Rosenstein appointed Mueller special counsel in May 2017, and has provided cover for the inquiry ever since. So it’s no surprise his potential exit would set off a panicky stampede. Indeed, legal observers worry that firing Rosenstein would be the first step of any effort by Trump to squash the investigation. Both Democrats and Republicans in Congress have warned that Trump risks sparking a constitutional crisis if he attempts to thwart the probe outright.

But while Trump could fire Rosenstein at any moment, that wouldn’t automatically spell the end of Mueller’s efforts. Trump would have a lot more work to do to halt the momentum Mueller has created, legal experts told VICE News.

“Firing Rosenstein would be a big deal, and it would set a horrible precedent,” said Mimi Rocah, a former prosecutor based in New York. “But at the same time, it would be very hard to put this entire train back in the station.”

Nearly two years into his investigation, Mueller has gathered reams of evidence after flipping senior members of Trump’s inner circle into cooperating witnesses, including Trump’s former campaign chairman Paul Manafort and his old self-styled “fixer” and attorney, Michael Cohen.

With so much now at stake, here’s what might await the Mueller investigation if Rosenstein quits or gets canned.

You're fired!?!?

Deputy Attorney General Rod Rosenstein speaks during an event at the Newseum, Tuesday, May 1, 2018 in Washington. Rosenstein says the Justice Department is still reviewing its policy that makes it difficult for prosecutors to subpoena reporters about their sources. (AP Photo/Andrew Harnik)

There was plenty of confusion regarding Rosenstein’s fate on Monday, especially when it came to whether the deputy attorney general would resign on his own or wait for Trump to fire him.

The difference could be pretty important, legal experts said.

If he quits, Trump would likely have greater leeway to appoint a friendly face as his replacement, according to Jens David Ohlin, Cornell Law vice dean. A firing, on the other hand, would likely leave Trump more constrained.

The reason behind this dynamic: A 1998 law called the Federal Vacancies Reform Act, which grants the president the power to appoint anyone already confirmed to a government job by the Senate.

Trump could cite that law, when appointing a Rosenstein replacement. But it is complex to the point of being “almost byzantine,” Ohlin said, leaving Trump open to potential legal challenges if he were to go that route.

The next in line

Rosenstein, the No. 2 official at the Department of Justice, is in charge of the Mueller probe because Attorney General Jeff Sessions recused himself per DOJ regulation forbidding department officials from investigating campaigns they were involved in. And if Rosenstein disappeared, that responsibility would fall to the next official technically in line: Solicitor General Noel Francisco.

Francisco, 49, is widely seen as a conservative Republican lawyer straight from central casting. His past writings suggest he holds a broad view of presidential power, indicating he might be inclined to support Trump’s right to rein in Mueller.

Francisco’s current job involves representing the government before the Supreme Court, where Francisco has been a powerful, if low-key, advocate for the Trump administration, including the president’s Constitutional authority to fire people.

Solicitor General nominee Noel Francisco testifies before the Senate Judiciary Committee's hearing on his nomination, on Capitol Hill in Washington, Wednesday, May 10, 2017. (AP Photo/Cliff Owen)

“The Constitution gives the president what the framers saw as the traditional means of ensuring accountability: the power to oversee executive officers through removal,” Francisco wrote in one recent court filing. “The president is accordingly authorized under our constitutional system to remove all principal officers, as well as all ‘inferior officers’ he has appointed.”

But people who know Francisco describe him to the press as a man with little appetite to run a criminal investigation, a job he’s never actually had before. Francisco might decide to recuse himself, because his former law firm, Jones Day, has been representing the Trump campaign.

If Francisco backs out, the buck would likely pass to Assistant Attorney General for the Office of Legal Counsel, Steve Engel, according to Marty Lederman, professor at Georgetown University Law Center.

What could he do?

Whoever takes over from Rosenstein would likely face pressure from Trump to clip Mueller’s wings. But straight-up firing Mueller would be no simple thing, legal experts told VICE News.

Rosenstein’s successor would be boxed in, to an extent, by existing Department of Justice guidelines, according to Harry Sandick, a former federal prosecutor and now white-collar defense lawyer.

“Mueller should be protected from termination by Department of Justice regulations that govern the appointment and work of a special counsel,” Sandick told VICE News.

But those rules might not be watertight, he said. “Some have raised constitutional objections to these regulations, saying that the president should have the right as chief executive to fire Mueller,” Sandick said. “No court has ruled on this issue.”

“Mueller should be protected from termination by Department of Justice regulations that govern the appointment and work of a special counsel.”

Replacing Rosenstein could still severely hamper the probe, even if the new guy doesn’t fire Mueller, according to Asha Rangappa, a legal expert at Yale’s Jackson Institute for Global Affairs.

A Trump-friendly official could simply slow the probe down by declining to approve new requests for investigative action. “The new [deputy attorney general] could burden the special counsel with a requirement to provide an explanation for every move he makes," Rangappa wrote for the Just Security blog, "and then decide that they aren’t necessary or appropriate.”

Even if Trump got that far, he might still have to go through Congress. On Monday, Democrats renewed calls to pass legislation that would protect the Mueller investigation. Republicans, however, have so far been reluctant to offer their support.

The cat’s already out of the bag

Mueller has set other probes in motion that have taken on lives of their own.

Cohen, Trump’s former “fixer,” pleaded guilty to eight counts in New York in August, including two stemming from campaign finance violations. Cohen said he helped orchestrate hush-money payments in fall 2016 to two women who claimed to have had sexual relationships with Trump. And he said that he did so at Trump’s direction.

“It would be extremely difficult to end the investigations.”

Cohen has reportedly spent hours answering questions about Trump’s ties with Russia during multiple interview sessions with Mueller’s team. But according to ABC News, he’s also reportedly cooperating with a separate probe by New York state authorities into the Trump family charity and the Trump Organization, where Cohen served as an executive vice president and special counsel to Trump for 10 years. Mueller has also spun off tangentially related probes to other offices, including to U.S. Attorneys in New York and Washington, D.C.

“It would be extremely difficult to end the investigations,” Sandick said. “This is especially true for the non-Mueller cases, of which there are now several.”