The San Francisco district attorney’s office dropped all criminal charges Friday against three sheriff’s deputies accused of forcing city jail inmates to fight each other in gladiator-style battles more than three years ago.

The decision to dismiss the inmate “fight club” case comes after prosecutors said they learned the Sheriff’s Department mishandled the investigation into deputies Scott Neu, Eugene Jones and Clifford Chiba by destroying evidence and improperly conducting joint administrative and criminal investigations.

The revelations of the botched probe offer the latest twist in a sensational legal saga that Public Defender Jeff Adachi exposed in March 2015, bringing scandal to then-Sheriff Ross Mirkarimi and the department and leading the city to settle a lawsuit filed by three inmates.

The San Francisco Deputy Sheriffs’ Association and attorneys for the defendants have long called the charges overblown. Neu’s attorney acknowledged that fighting had occurred, but he said his client was allowing inmates to wrestle as a way to “blow off steam.”

While San Francisco Superior Court Judge Ross Moody granted the district attorney’s motion to dismiss the criminal charges that carried possible state prison terms, a new prosecution team will review the case to determine whether there is enough untainted evidence to proceed with new charges.

At the center of the dismissal decision are statements the deputies were required to make during an internal affairs investigation by the Sheriff’s Department. Such statements, known as “compelled statements,” cannot legally be used in criminal probes because they violate a defendant’s Fifth Amendment right against self-incrimination.

Law enforcement agencies usually isolate administrative and criminal investigations from each other in a process called “walling off” to avoid such conflicts.

As the district attorney’s office and FBI began investigating the case in April 2015, they learned that the Sheriff’s Department had been conducting its own criminal investigation and had interviewed more than 40 witnesses and compiled several binders of evidence.

The sheriff’s criminal investigators, however, had been working alongside internal affairs during the probe, prosecutors said.

“Even after the administrative investigators had obtained compelled statements from the defendants, the administrative and criminal investigators jointly prepared for and conducted interviews of numerous witnesses,” Assistant Chief District Attorney Evan Ackiron wrote in a motion to dismiss the charges.

Some of the investigators’ interview questions, prosecutors said, were informed by “compelled interviews from the defendants.”

The district attorney’s office initially believed the case wasn’t tainted despite the bungled investigations, officials said. Senior Deputy Vincent Chew, who was leading the sheriff’s criminal investigation, testified during a November 2016 hearing that he had not seen or received any compelled statements, and no such statements were in the criminal case file he submitted to prosecutors.

Things began to unravel after prosecutors learned potential evidence in the case had allegedly been destroyed.

When Neu’s defense attorneys learned about the conflicts with the investigations, they requested the department’s internal communications to make sure tainted evidence wasn’t handed over to the district attorney’s office.

Neu’s attorneys said they soon discovered that important department emails from internal affairs investigator Sgt. David Murphy had been deleted during the investigation. When the attorneys asked to search his laptop to try to recover the deleted emails, “the Sheriff’s Department admitted that Sgt. Murphy’s laptop ‘had been destroyed,’” Neu’s attorney, Nicole Pifari, wrote in a December motion to dismiss the case.

“Upon further inquiry, the Sheriff’s Department explained that ‘sometime in October,’ approximately seven months after they had received two preservation demands, the Sheriff’s Department destroyed the laptop’s hard drive by smashing it with a hammer,” Pifari wrote.

Since taking over the Sheriff’s Department in 2016, Sheriff Vicki Hennessy “has updated and reaffirmed the department’s criminal and administrative procedures and training to ensure the integrity of all investigations and secure accountability,” department spokeswoman Nancy Crowley wrote in an email Friday.

Harry Stern, another attorney for Neu, blasted the district attorney’s office in court Friday while unsuccessfully asking Judge Moody to grant his motion to dismiss the case “with prejudice,” so prosecutors could not refile charges.

“They waited four years, and now we get this 11th-hour dismissal,” Stern said. “We’re glad about that. Let’s keep in mind this is the end of four years of hell basically for the clients. I don’t like their attempt to divorce themselves from responsibility and not be accountable.”

The allegations against the deputies were exposed by Adachi, who said sheriff’s deputies arranged and gambled on fights between inmates during a two-day period in early March 2015, at County Jail No. 4 on the seventh floor of the Hall of Justice at 850 Bryant St.

The deputies threatened inmates with violence or withheld food if they didn’t fight each other for the deputies’ amusement, Adachi said.

A yearlong investigation followed, and in March 2016 the district attorney’s office charged Neu, the group’s alleged ringleader, with 17 criminal counts, including assault under color of authority, making threats, inhumanity to a prisoner and cruel and unusual punishment.

Neu faced up to 10 years in prison.

Jones and Chiba were accused of assault under color of authority, inflicting cruel and unusual punishment and breaching official duties.

All three deputies pleaded not guilty. Neu was later fired, Jones was suspended without pay, and Chiba was placed in a position where he does not have contact with inmates.

The inmates — Ricardo Palikiko-Garcia, Stanley Harris and Keith Richardson — filed a civil rights lawsuit against the city and Sheriff’s Department and settled in September 2016 for $90,000.

Despite dismissing the charges, the district attorney’s office said it will forward the case to its Independent Investigations Bureau, a unit tasked with investigating officer use-of-force incidents, officer-involved shootings and in-custody deaths.

“Because the underlying allegations, that the San Francisco Sheriff’s Department deputies forced jail inmates to fight each other, are so serious, the district attorney’s investigation is not over,” Ackiron wrote.

But given the complexities of the case, Stern and the judge separately said it is unlikely that the district attorney would be able to put together an untainted case.

“If they attempt to refile this case, we would come at them with both barrels blazing,” Stern said.

Evan Sernoffsky is a San Francisco Chronicle staff writer. Email: esernoffsky@sfchronicle.com Twitter: @EvanSernoffsky