An outspoken New York federal prosecutor known for fiercely railing against public corruption has been fired after he refused an order from Donald Trump's administration to stand down.

It emerged on Friday that Attorney General Jeff Sessions was seeking the resignations of 46 US attorneys who served under the leadership of Barack Obama.

However, US Attorney Preet Bharara refused to resign, announcing on Twitter on Saturday that he was instead sacked from his position.

"I did not resign," he said. "Moments ago I was fired. Being the US Attorney in SDNY will forever be the greatest honour of my professional life."

His dismissal comes months after he met with the President at Trump Tower, telling reporters afterwards the president had asked him to stay on and he was intending to do so.

Many of the federal prosecutors who were nominated by Mr Obama had already left their positions before the request, but some had stayed on in the first weeks of the Trump administration.

Justice Department spokeswoman Sarah Isgur Flores said on Friday the forced resignations were necessary “in order to ensure a uniform transition”.

“Until the new US attorneys are confirmed, the dedicated career prosecutors in our US attorney's offices will continue the great work of the department in investigating, prosecuting and deterring the most violent offenders,” she said in a statement.

Within hours of the order, US attorneys around the country — including in New Jersey, Rhode Island, Minnesota and Montana — had publicly announced their resignations.

Although it is customary for the 93 US attorneys to leave their positions when a new President enters the office, the changes do not usually happen all at once. Mr Sessions lost his position as US attorney for the Southern District of Alabama in a similar sweep by then-Attorney General Janet Reno in 1993.

In pictures: Protests, pomp and Donald Trump Show all 30 1 /30 In pictures: Protests, pomp and Donald Trump In pictures: Protests, pomp and Donald Trump President-elect Donald Trump acknowledges guests as he arrives on the platform at the US Capitol in Washington DC Getty Images In pictures: Protests, pomp and Donald Trump Donald Trump is sworn in as the 45th president of the United States by Chief Justice John Roberts as Melania Trump looks on during the 58th Presidential Inauguration at the U.S. Capitol in Washington AP In pictures: Protests, pomp and Donald Trump President Donald Trump shakes hands with Justice John Roberts after taking the oath at inauguration ceremonies swearing in Trump as the 45th president of the United States Reuters In pictures: Protests, pomp and Donald Trump President Donald Trump raises his fists after his inauguration on the West Front of the U.S. Capitol Getty In pictures: Protests, pomp and Donald Trump U.S. President-elect Donald Trump greets outgoing President Barack Obama before Trump is inaugurated during ceremonies on the Capitol in Washington Reuters In pictures: Protests, pomp and Donald Trump resident-elect Donald Trump arrives on the platform of the US Capitol in Washington DC Getty Images In pictures: Protests, pomp and Donald Trump Attendees partake in the inauguration ceremonies to swear in Donald Trump as the 45th president of the United States at the U.S. Capitol in Washington DC Reuters In pictures: Protests, pomp and Donald Trump US President Donald Trump delivers his inaugural address during ceremonies at the US Capitol in Washington DC Getty In pictures: Protests, pomp and Donald Trump U.S. President Donald Trump waves with wife Melania during the Inaugural Parade in Washington DC Reuters In pictures: Protests, pomp and Donald Trump Protesters registered their rage against the new president Friday in a chaotic confrontation with police who used pepper spray and stun grenades in a melee just blocks from Donald Trump's inaugural parade route. Scores were arrested for trashing property and attacking officers AP In pictures: Protests, pomp and Donald Trump Demonstrators protest against US President Donald Trump in Washington DC Getty Images In pictures: Protests, pomp and Donald Trump A woman holds a sign before the start of the Presidential Inauguration of Donald Trump at Freedom Plaza in Washington DC Getty Images In pictures: Protests, pomp and Donald Trump Anti-Trump protesters prepare banners for a protest against the inauguration of US President-elect Donald Trump, in Berlin REUTERS In pictures: Protests, pomp and Donald Trump Demonstrators shout slogans against US President-elect Donald Trump in Washington DC Getty Images In pictures: Protests, pomp and Donald Trump Demonstrators march, block foot traffic and clash with U.S. Capitol Police at the entry checkpoints for the Inauguration of Donald Trump Alamy Live News In pictures: Protests, pomp and Donald Trump Demonstrators display a banner as people arrive for US President-elect Donald Trump's inauguration in Washington DC Getty Images In pictures: Protests, pomp and Donald Trump A man displays a placard as people lineup to get into the National Mall for the inauguration of US President-elect Donald Trump in Washington DC Getty Images In pictures: Protests, pomp and Donald Trump Protesters demonstrating against U.S. President Donald Trump raise their hands as they are surrounded by police on the sidelines of the inauguration in Washington DC Reuters In pictures: Protests, pomp and Donald Trump A demonstrator wearing a mask depicting Donald Trump protests outside the US Embassy in London Getty Images In pictures: Protests, pomp and Donald Trump Demonstrators hold placards as they protest outside the US Embassy in London Getty Images In pictures: Protests, pomp and Donald Trump Former US President George W. Bush and First Lady Laura Bush arrive for the Presidential Inauguration at the US Capitol Rex In pictures: Protests, pomp and Donald Trump Michelle Obama and Dr. Jill Biden share an umbrella as President Donald Trump delivers his inaugural address at the inauguration in Washington DC Rex In pictures: Protests, pomp and Donald Trump Former Democratic presidential nominee Hillary Clinton and former President Bill Clinton arrive on the West Front of the U.S. Capitol in Washington Reuters In pictures: Protests, pomp and Donald Trump U.S. Vice President Mike Pence takes the oath of office on the West Front of the U.S. Capitol in Washington, DC Getty Images In pictures: Protests, pomp and Donald Trump Advisors to President-elect Donald Trump, Kellyanne Conway and Steve Bannon depart from services at St. John's Church during the Presidential Inauguration in Washington Reuters In pictures: Protests, pomp and Donald Trump Protesters demonstrating against U.S. President Donald Trump take cover as they are hit by pepper spray by police on the sidelines of the inauguration in Washington DC Reuters In pictures: Protests, pomp and Donald Trump An activist demonstrating against U.S. President Donald Trump is helped after being hit by pepper spray on the sidelines of the inauguration in Washington DC Reuters In pictures: Protests, pomp and Donald Trump A police officer tries to tackle a protester demonstrating against U.S. President Donald Trump Reuters/Adrees Latif In pictures: Protests, pomp and Donald Trump Police arrest and detain a protester in the street in Washington DC Rex In pictures: Protests, pomp and Donald Trump A police officer falls to the ground as another shoots pepper spray at protesters demonstrating against U.S. President Donald Trump on the sidelines of the inauguration in Washington DC Reuters

Questions about Mr Bharara were directed to the Justice Department by the White House on Saturday.

Mr Bharara was appointed by Mr Obama in 2009. In frequent public appearances, Mr Bharara has decried public corruption after successfully prosecuting over a dozen state lawmakers, Democrats and Republicans alike.

One US attorney appointed by President George W Bush – Rod Rosenstein of Maryland – remained in his position for the duration of the Obama administration.

A Justice Department spokesman, Peter Carr, said Mr Trump has asked Rosenstein and Acting Deputy Attorney General Dana Boente, who has served as US attorney for the Eastern District of Virginia, to stay on.

Tim Purdon, a former US attorney for North Dakota in the Obama administration, recalled that President Barack Obama permitted Bush appointees to remain on until their successors had been appointed and confirmed.

“The way the Obama administration handled it was appropriate and respectful and classy,” he said. “This saddens me because many of these people are great public servants and now they are being asked to leave.”

Montana's US Attorney Mike Cotter said he received a phone call from Acting Attorney General Dana Boente telling him “the president has directed this".

“I think it's very unprofessional and I'm very disappointed,” he said. “What happened today on Friday, March 10, that was so important that all Obama appointees who are US attorneys need to be gone?”

“I gotta write that [resignation] letter. It's going to be a one-liner,” he added.

New York Senator Charles Schumer, a Democrat, said in a statement last week that he was “troubled to learn” of the resignation demands, particularly of Mr Bharara, since Mr Trump called him in November and assured him that he wanted Bharara to remain Manhattan's top federal prosecutor.

Mr Schumer said that by requesting immediate resignations, Mr Trump was “interrupting ongoing cases and investigations and hindering the administration of justice.”

Mr Bharara, who was once lauded on the cover of Time magazine as the man who is “busting Wall Street” after successfully prosecuting dozens of insider traders, has in the past few years set his sights on prosecuting over a dozen state officeholders — Democrats and Republicans — including New York's two most powerful legislators.

The request from Mr Sessions came as Bharara's office is prosecuting former associates of Democratic Govenor Andrew Cuomo in a bribery case. Also, prosecutors recently interviewed New York City Mayor Bill de Blasio as part of a probe into his fundraising. The mayor's press secretary has said the mayor is cooperating and that he and his staff had acted appropriately.

Mr Sessions' decision to include Mr Bharara's name on the list of resignations of holdovers from the Obama administration surprised Manhattan prosecutors and other political figures.

New York State Assemblyman Steven McLaughlin, a Republican, had urged Mr Trump and Mr Sessions to reconsider. “Big mistake,” he wrote on Twitter.

The request for resignations came just days after Mr Trump claimed that Mr Obama tapped his telephones during last year's election. FBI Director James Comey privately asked the Justice Department to dispute the claim because he believed the allegations were false. Mr Bharara worked for Mr Comey when he was US attorney in Manhattan under President George W Bush.