If President Donald Trump is serious about his pledge to "drain the swamp," his administration may have fired the high-profile New York prosecutor who is actually doing it, supporters of the now-former U.S. attorney said Saturday.

Preet Bharara, whose term as U.S. Attorney for the Southern District of New York was marked by the successful corruption prosecutions of over a dozen state lawmakers, said he was fired Saturday after refusing to step down as ordered by the Trump administration.

"I did not resign. Moments ago I was fired," Bharara, appointed by President Barack Obama in 2009, said on Twitter Saturday. In November Bharara said after meeting with Trump that he was asked to stay on and agreed to do so.

More from NBC News:



Way in which US attorneys told to resign came as surprise: Source

Trump administration tells remaining US attorneys to resign

Is Trump's new executive order on travel 'new' enough?

The order for all remaining U.S. attorneys to resign was not unprecedented — all state's attorneys are political appointees who serve at the pleasure of the president. In 1993, Attorney General Janet Reno demanded the resignations of all 93 U.S. attorneys in the early days of the Clinton administration.

But Bharara's record in pursuing corruption cases against both Republicans and Democrats alike — including winning convictions on corruption charges against the two top leaders of the state legislature — had some New York politicians of both parties questioning the move.

"Preet Bharara has shaken the foundations of our capital — whether you're a Republican or Democrat he's been an equal opportunist when it comes to rooting out corruption," New York State Sen. Todd Kaminsky, a former federal prosecutor, said on MSNBC-TV Saturday.

New York State Assemblyman Steve McLaughlin, a Republican who was an adopter of Trump's "drain the swamp" pledge, Tweeted "Definitely not a wise move at all."

"Also not hard to see that he's [Bharara] been a fighter trying to #Draintheswamp," McLaughlin said in response to a follower.

".@USAGSessions Sir, please strongly reconsider asking @USAttyBharara to resign. We need him here in NY to #Draintheswamp," McLaughlin tweeted.

Bharara aggressively pursued insider trading cases, and Time magazine in 2012 put him on the cover with the headline "This Man Is Busting Wall St."

Prosecution against SAC Capital on fraud charges ended in the hedge fund group being hit with a record penalty of $1.8 billion in 2014. After his office charged JP Morgan Chase over the massive Bernie Madoff Ponzi scheme, the bank agreed to a $1.7 billion settlement.

Prosecutions sent Times Square bomb plotter Faisal Shahzad to prison for life. Bharara's office successfully prosecuted Al Qaeda terrorist Khalid Al-Fawwaz in 2015 for the bombings of U.S. embassies in Kenya and Tanzania.

More recently, Bharara went after a former aide to New York Gov. Andrew Cuomo, Joseph Percoco, who allegedly sought and accepted over $300,000 in bribes.

The indictment in that case said that some of the funds were referred to as "ziti" which was a code word used for money that "Percoco came up with based on the use of the term in the television show "The Sopranos.""

Former attorney general Alberto Gonzales said Saturday that "there's nothing at all unusual" about the Trump administration's request that all remaining U.S. attorneys resign, and said Bharara should have stepped down rather than defy the order.

"Every president and every U.S. attorney general wants to have their own set of field generals in the U.S. attorney position to help carry out the attorney general's law enforcement priorities," Gonzales said on MSNBC Saturday.

Gonzales, who served under President George W. Bush, bristled at criticism he said was raised by Bharara over controversial mid-term replacements of several U.S. attorneys under Bush.

Bharara "was very much involved in raising that as a political issue, and I find it somewhat ironic that we find ourselves here today where he's refusing to respect the authority of the president of the United States, and it comes to the point where he's in essence fired from the position," Gonzales said.

Former Democratic National Committee chairman Howard Dean called him "a great and fearless public servant" and said "you will be called upon again."

Bharara in a statement called his time as U.S. attorney the greatest honor of his professional life. "One hallmark of justice is absolute independence, and that was my touchstone every day that I served," he said.

Kaminsky, the Democratic state lawmaker, suggested Bharara's refusal to resign was intended to send a message. "If the president was serious about draining the swamp, this is certainly not something he would do," he said of Bharara's firing.

"I think Mr. Bharara wanted to set the record straight by saying, 'I was ready to continue to do this job. If you don't want me here, that's on you,' " Kaminsky said.