The announcement that Bharara had been told to resign created feelings of whiplash inside his office, according to two people familiar with the views of current prosecutors. One of the people described an oddly subdued reaction mixed with anxiety as the events unfolded. "You have a sense of how it's going to end and it's not going to end well," this person said.

In November, Bharara met at Trump Tower with the president and several of his advisers, including Trump's son-in-law, Jared Kushner, and his chief strategist, Stephen Bannon, according to two people briefed on that discussion who requested anonymity to describe a private meeting with Trump.

At the meeting, according to those briefed, Trump urged Bharara to remain in the job. Bharara said after the meeting, "I agreed to stay on."

Bharara's dismissal came about a year into his office's investigation of de Blasio's campaign fundraising, an inquiry that is examining whether the mayor or his aides traded beneficial city action for political donations. And Bharara leaves his post at a sensitive juncture: De Blasio was interviewed recently by prosecutors who appear to be in the final stages of determining whether to seek charges in the matter.