The call to Preet Bharara’s office from President Trump’s assistant came on Thursday. Would Mr. Bharara, the United States attorney in Manhattan, please call back?
The following day, Mr. Bharara was one of 46 United States attorneys appointed by President Barack Obama asked to resign — and to immediately clean out their offices. The request took many in his office by surprise because, in a meeting in November, Mr. Bharara was asked by the then-president-elect to stay on.
Mr. Bharara refused to resign. On Saturday, he announced on Twitter that he had been fired.
It was unclear whether the president’s call on Thursday was an effort to explain his change of heart about keeping Mr. Bharara or to discuss another matter. The White House would not comment on Saturday.
However, there are protocols governing a president’s direct contact with federal prosecutors. According to two people with knowledge of the events who were not authorized to discuss delicate conversations publicly, Mr. Bharara notified an adviser to the attorney general, Jeff Sessions, that the president had tried to contact him and that he would not respond because of those protocols. Mr. Bharara then called Mr. Trump’s assistant back to say he could not speak with the president, citing the protocols.
Mr. Bharara was a highly public prosecutor who relished the spotlight throughout more than seven years in office. He pursued several high-profile cases involving Wall Street, and he was in the midst of investigating fund-raising by Bill de Blasio, the mayor of New York, and preparing to try former top aides to the governor of New York, Andrew M. Cuomo, who are both Democrats. It was not immediately clear how his departure would affect those cases and others that were pending.
Mr. Bharara stayed quiet until Saturday afternoon. Then, on his personal Twitter account, which he set up eight days ago, he wrote: “I did not resign. Moments ago I was fired.” Referring to the Southern District of New York, he continued, “Being the US Attorney in SDNY will forever be the greatest honor of my professional life.”
Peter Carr, a Justice Department spokesman, declined to characterize Mr. Bharara’s departure that way, saying only, “I can confirm that Mr. Bharara is no longer the U.S. attorney for the Southern District of New York.”
All presidents choose their own appointees for United States attorney positions and almost always ask those from their predecessors to leave. But the process under Mr. Trump was unusually abrupt, and it was yet another rocky encounter between the Trump administration and the nation’s law enforcement apparatus.
Mr. Bharara’s job had appeared to be secure. In November, he met at Trump Tower with the president-elect and several of his advisers, including Mr. Trump’s son-in-law, Jared Kushner, and his chief strategist, Stephen K. Bannon, according to two people briefed on that discussion who requested anonymity.
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.
Mr. Bharara’s office is overseeing the case against the former aides to Mr. Cuomo and the inquiry into fund-raising by Mr. de Blasio, who has been a target of Mr. Trump’s ire as he has positioned himself as a vocal opponent of the president’s on the left.
His office is also overseeing an investigation into whether Fox News, which is owned by the media magnate Rupert Murdoch, failed to properly alert shareholders of settlements with female employees who had accused the channel’s former chief, Roger Ailes, of sexual harassment.
The investigation of Mr. de Blasio’s campaign fund-raising has been going on for about a year and is examining whether the mayor or his aides traded beneficial city action for political donations. Mr. de Blasio was interviewed recently by prosecutors who appeared to be in the final stages of determining whether to seek charges in the matter. Mr. de Blasio’s press secretary has said that the mayor has cooperated with Mr. Bharara’s inquiry and that he and his staff had “acted appropriately and well within the law.”
White House officials have said little about the timing of the mass push for resignations, other than insisting it had not been a response to a call for a purge on Fox News, where one host, Sean Hannity, urged the president to clean house at the Justice Department.
Phil Singer, a former aide to Mr. Schumer and a Democratic strategist, called it “absurd” to suggest that Mr. Bharara’s firing had been meant to punish Mr. Schumer. He noted that any investigation involving Trump Tower would fall within the purview of Mr. Bharara’s office.
The Southern District of New York, which Mr. Bharara has overseen since 2009, encompasses Manhattan, Mr. Trump’s home before he was elected president, as well as the Bronx, Westchester County and other counties north of New York City.
The Thursday afternoon phone call from the Oval Office was a curious sidelight to the fast-moving events. Mr. Trump’s assistant asked the prosecutor to return the call. Before doing so, Mr. Bharara called Mr. Sessions’s chief of staff, Jody Hunt, to alert the Justice Department to the call and express concern about contacts between presidents and federal prosecutors.
Aides to Mr. Trump did not respond to three emails seeking comment about the nature of Mr. Trump’s call to Mr. Bharara.
Reporting was contributed by Matt Apuzzo, Thomas Kaplan, William K. Rashbaum, Eli Rosenberg and Benjamin Weiser.
A version of this article appears in print on March 12, 2017, on Page A1 of the New York edition with the headline: U.S. Attorney in New York: ‘I Was Fired’.