Deputy Attorney General Rod Rosenstein just did Donald Trump a favor.

It may not look like that from the perspective of the president. His Twitter feed is filled with eruptions about the fraudulence of the Russia investigation. But by appointing the former FBI Director Robert Mueller to investigate the matter, Rosenstein has quieted a crisis that was consuming Trump’s presidency.

The storm has been gathering for more than a week. It started when Trump impetuously fired FBI Director James Comey, claiming at first that he did so on the advice of Rosenstein. Then the president changed his story and told NBC News that he was going to fire Comey anyway and that part of this was because the bureau’s Russia investigation was dragging on.

The Comey camp soon struck back. First, his allies leaked that Trump had asked Comey for his loyalty back in January over dinner. Then, in a more damaging story, The New York Times reported on a memo Comey had written to record a conversation in which Trump asked him to drop the investigation into Michael Flynn, the national security adviser Trump fired after three weeks on the job.

The Russia probe was consuming Trump’s presidency.

Now, Rosenstein has offered the president a reset. Trump has a chance to try to focus on foreign and domestic policy. And in this respect the timing is fortunate.

Trump will travel to Saudi Arabia, Israel, Italy and Belgium on his first foreign trip as president, starting Friday. He plans to press Arab allies to form a new alliance against Iran. He hopes to restart the Israeli-Palestinian peace process. He has a chance to lock down greater spending commitments from NATO allies.

On the domestic front, Trump can now focus on getting his health-care legislation and tax cuts through the Senate.

This is not to say there are not risks. A special counsel has the authority to pursue all kinds of leads, even if they are not about collusion with Russia during the election. As anyone who remembers the 1990s can attest, these investigations can begin by looking into shady land deals in Arkansas and end up documenting a president’s sexual dalliances with a White House intern.

But Mueller is trusted by both parties. In his dozen years as FBI director, he avoided major scandals. He also sidestepped political pitfalls that have tarnished the legacy of Comey and another FBI director, Louis Freeh, who spent his years investigating the Clintons.

This may end up offering a chance for redemption to Flynn, whom Trump has defended publicly since firing him. So far, much is unclear — not only whether Flynn is innocent or guilty, but even what law he might have broken.

Flynn’s legal troubles likely come from his failure to properly report foreign income.

One source close to Flynn told me that the Justice Department had opened an investigation into Flynn after the election in November for failing to register his work on behalf of a Turkish businessman, pursuant to the Foreign Agents Registration Act. Flynn had instead reported this income through the more lax Lobbying Disclosure Act. After his resignation, Flynn registered as a foreign agent for Turkey.

Flynn also failed to report with the Pentagon his payment in 2015 from Russia’s propaganda network, RT, for a speech in Moscow at the network’s annual gala. Flynn did brief the Defense Intelligence Agency about that trip before and after he attended the RT gala. The Pentagon also renewed his top-secret security clearance after that trip.

Another potential problem for Flynn could be that he was not truthful with the FBI when its agents interviewed him in January. He agreed to the interview without a lawyer, signaling he did not have anything to hide.

Flynn now appears to be a subject of the FBI’s counterintelligence investigation. He, Paul Manafort and two other Trump associates — political operative Roger Stone and businessman Carter Page — have had their reputations stained in news stories quoting anonymous leaks. Mueller now has a chance to evaluate the investigation that has allegedly generated these leaks and pursue the facts where they lead.

The prospect of closure and a legitimate investigation is good for the country. It’s also good for Flynn, Manafort, Page and Stone, who have expressed through counsel and in their own words their innocence. And while Trump may not know it, the special counsel has offered his flailing presidency a lifeline.

© 2017, Bloomberg View