Chuck Rhoades wouldn’t go down without a fight, and neither did Preet Bharara, the former U.S. attorney for the Southern District of New York.

The Trump administration’s mass firing of 46 U.S. Attorneys appointed during the Obama years generated a tidal wave of social media commentary on Saturday. Among the most talked-about was the dismissal of Bharara, who has filled the role of Manhattan’s top federal prosecutor since May 2009.

Bharara was in part the inspiration for the Rhoades character who holds the same job in the Showtime drama “Billions.” Paul Giamatti plays the oh-so-intense federal prosecutor in the much-praised series, which is now in its second season and was renewed earlier this week for season three.

Bharara added some dramatic flair to his dismissal by refusing to grant the administration’s request that he offer his resignation. That gave him a solid fourth-act storyline — being formally fired on Saturday by acting deputy attorney general Dana Boente. Bharara let it be known that he had met with President Trump during the post-election transition and had been told he would be staying on in his job.

Bharara maintained a high profile in New York media and social circles, by virtue of his office and his focus on white-collar crime and Wall Street malfeasance, particularly insider trading. Bharara’s pursuit of hedge fund king Steven A. Cohen was a source of inspiration for the central storyline of “Billions”: Rhoades’ single-minded pursuit of hedge fund billionaire Bobby Axelrod, played by Damian Lewis. Cohen’s SAC Capital Partners wound up settling with the government and closing its fund after pleading guilty to failing to supervise an employee convicted of insider trading.

“Billions” has mined the drama of the backroom deals, inter-agency rivalries and naked political jockeying that influence decision-making at the powerful U.S. Attorney’s office. This season, Rhoades is feeling the heat of an internal investigation for corruption. “Billions” viewers know that Rhoades is guilty of less-than-legal conduct in his zealous effort to trap Axelrod, even if he’s not culpable for the transgressions that internal affairs investigator Oliver Dake, played by Christopher Denham, is chasing down.

On Bharara’s watch, the 220 assistant U.S. Attorneys in the Southern District have been aggressive in probing state and local government corruption, resulting in the arrests of entrenched power players in Albany and New York City. They also took aim at cybercrime activity and the hacking orgs LulzSec and Anonymous.

Bharara’s experience and media profile ensures he will have no shortage of options for his next move.

Not surprisingly, “Billions” co-creator and exec producer Brian Koppelman paid tribute to Bharara on Saturday.