The federal criminal case against former prosecutor Paul Bergrin has been reassigned, following an appeals court’s finding that the original judge appeared to harbor a pro-defense bias.

U.S. District Judge Dennis Cavanaugh was assigned randomly to the high-profile case, which in its three-year duration has entailed judge-prosecutor clashes, a hung jury and several appeals.

Bergrin, 56, an assistant U.S. attorney from 1985 to 1990 and assistant Essex County prosecutor before that, is charged in a 33-count indictment with running a crime ring through his firm, the Bergrin Law Enterprise of Newark.

On June 15, the U.S. Court of Appeals for the Third Circuit ordered U.S. District Judge William Martini ousted from the case, citing his “repeated expressions of discomfort with” charges lodged under the Racketeer Influenced and Corrupt Organizations Act.

The panel cited Martini’s dismissal of the RICO counts — later reversed on appeal — and his severance of those counts from others, saying he apparently “believes that it is impossible for Bergrin to get a fair trial on the RICO counts due to the very nature of RICO.”

Besides the RICO charges, Bergrin is charged in the death of an FBI informant and witness in a drug case against a Bergrin client, William Baskerville. Kemo McCray was shot to death in 2004, after Bergrin allegedly told Baskerville’s associates, “No Kemo, no case.”

Bergrin is charged with plotting to kill a witness slated to testify against another of his clients, Richard Pozo, who was defending drug charges in Texas federal court in 2004.

And he is charged with plotting the murder of “Junior the Panamanian,” a prosecution witness in a 2008 Monmouth County Superior Court drug case against another client, Vincent Esteves. Bergrin was recorded planning the murder’s intricacies — “we gotta make it look like a robbery” — by a government informant.

Martini dismissed the RICO counts in April 2010, holding them insufficiently pleaded, but the Third Circuit reinstated them a year later.

Martini frustrated prosecutors by severing the counts related to McCray and ordering them tried first. The judge expressed concerns that the jury could convict Bergrin based on evidence related to the Esteves counts — conduct that allegedly occurred four years later.

Then, after previously indicating he would allow some evidence of the Esteves and Pozo plots in the trial of the McCray counts, Martini excluded it.

Following a six-week trial and six days of deliberation with no verdict, Martini declared a mistrial last Nov. 23.

The government appealed the evidentiary rulings and moved to try the remaining counts, but in December, at Bergrin’s urging, Martini severed the RICO and non-RICO counts, ordering the latter to be tried first. He again cited fairness and prejudice concerns.

It was the last straw for prosecutors, who filed a second appeal and asked for Martini’s removal. They said he belittled the RICO counts, noting he remarked that the government “can charge a ham sandwich” so it “doesn’t take a whole lot to charge a RICO case.”

U.S. Circuit Judges Kent Jordan, Julio Fuentes and D. Brooks Smith held it wasn’t Martini’s “prerogative to construct a detour around RICO,” saying the statute allows for blending allegations to show patterned racketeering activity.

Aside from ordering reassignment, they vacated Martini’s ruling on the Pozo evidence and left other evidentiary issues for the new judge to decide.

Cavanaugh, assigned by Chief Judge Jerome Simandle on Aug. 2, was selected by “the wheel” — the computerized process used by the court clerk to assign new cases, which takes judges’ case loads into account.

A district judge since July 2000 and a magistrate judge for seven years before that, Cavanaugh is well-regarded by practitioners for his evenhandedness and good relations with the bar.

In the Law Journal‘s most recent survey of lawyers about the judges of the District of New Jersey, published in May 2008, Cavanaugh was rated 9.03 on a 1-to-10 scale for lack of bias as to race, gender and political party identity; 8.71 for courteous and respectful treatment of litigants and lawyers; and 8.18 for skillfully fostering settlement. His score of 8.15 in overall competence placed him 13th in a field of 24 district judges, one slot ahead of Martini.

On Wednesday, Cavanaugh set oral argument on the evidentiary issues for Sept. 12 and a trial for Oct. 1.

U.S. Attorney’s Office spokesman Matthew Reilly declines comment.

Bergrin’s lawyer, Lawrence Lustberg of Gibbons in Newark, did not respond to a call and email.