At the meeting, according to those briefed, Mr. Trump asked Mr. Bharara to remain in the job, which Mr. Bharara relayed to reporters and television cameras in the Trump Tower lobby.

Then came the order to resign on Friday, creating what was described as a feeling of whiplash in the prosecutor’s Manhattan office. One person familiar with the views of current prosecutors 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,” the person said.

But Mr. Bharara, unlike his fellow United States attorneys, publicly refused to leave. He gave no statement citing a policy or legal issue affecting his decision to refuse the resignation order.

It was unclear how many of the 46 holdovers had submitted resignations. Mr. Bharara’s colleague Robert L. Capers, the United States attorney in Brooklyn, announced his resignation Friday.

Two White House officials, speaking on condition of anonymity to avoid offending the president, said the promise to keep Mr. Bharara on was a product of a chaotic transition process and Mr. Trump’s desire at the time to try to work with Senator Chuck Schumer, Democrat of New York, with whom Mr. Bharara is close. The relationship between Mr. Trump and Mr. Schumer, the Senate minority leader, has since soured.

It was Dana Boente, the acting deputy attorney general, who called Mr. Bharara on Saturday. According to a Justice Department official, Mr. Boente told Mr. Bharara that he was one of the 46 United States attorneys being told to resign.

Mr. Bharara, the official said, replied that that was in conflict with Mr. Trump asking him to stay on. Mr. Boente reiterated that Mr. Bharara was being asked to resign, and Mr. Bharara said that he was interpreting that as being fired. Mr. Boente then said again that the department was asking him to step down, according to the official.