Shortly after Robert S. Mueller III was appointed to investigate possible coordination between President Trump’s campaign and the Kremlin, he was drawn into a tense standoff in which Deputy Attorney General Rod J. Rosenstein and then-acting FBI director Andrew McCabe each urged the other to step aside from the case, according to people familiar with the matter.

At the time of the confrontation in mid-May 2017, tensions were running high at the FBI and Justice Department, and between Rosenstein and McCabe. Trump had just fired James B. Comey as the bureau’s director, and almost immediately afterward, FBI officials had opened a case into whether the president had obstructed justice.

Some in the bureau eyed Rosenstein warily, because he had authored a memo that was used by the administration to justify Comey’s termination. If the president had obstructed justice, they reasoned, Rosenstein may have played a role in that. Justice Department officials, meanwhile, were concerned that the FBI — and McCabe in particular — may have acted too hastily to open an investigative file on the president after Comey was fired and that the move could be painted as an act of anger or revenge.