Brandon Fox sits in his new office at the law firm of Jenner & Block on the 35th floor of the U.S. Bank building in downtown Los Angeles, and reflects on the intense legal battles he led against former L.A. County Sheriff Lee Baca and numerous other sheriff's officials at the federal courthouse a few blocks away.

"We needed to do something to stop that culture" of impunity, he says.

Baca is scheduled to begin a three-year prison sentence Tuesday stemming from his March conviction for obstruction of justice and lying to federal investigators to cover up inmate abuse inside Men’s Central Jail. The former sheriff, who has Alzheimer's disease, has asked the 9th Circuit Court of Appeals to let him remain free while he appeals the verdict. The court is expected to rule Monday.

The wide-ranging federal investigation that began in 2011 led to the conviction of 21 sheriff’s officials for excessive use of force, obstruction of justice and other charges. All were sent to federal prison.

Fox recalls how he was put in charge of investigating top sheriff’s officials as soon as he arrived in L.A. from Chicago five years ago to take up his job as an assistant US attorney.

At the time, FBI agents suspected the officials were trying to cover up inmate abuse inside the jail.

"What I found out absolutely shocked me," Fox says. Sheriff’s deputies had stopped an FBI agent outside her home and threatened to arrest her if the agency didn’t stop investigating the abuses.

"There is no way, for example, that the Chicago Police Department – with all of its issues – would have thought about doing that," he says.

Fox says he tried to bring a dispassionate approach to an investigative team whose leaders personally knew some of the sheriff’s officials who were trying to block their inquiry.

The investigation found the corruption ran very deep, he says.

"The people who were most involved in the obstruction of justice –they were people within their internal investigations bureau," says Fox. "Their job was to prove crimes against other deputies who had been involved in crimes. But instead they tried to cover them up and tried to get the federal government to back away."

He says that "there were many times we heard [internal investigations bureau] interviews with the victims starting out asking if they were drunk, if they were on drugs, if they were in gangs, before hearing what their story was."

After winning a series of convictions of lower-level officials, Fox and his team suffered a huge defeat. When Baca went on trial late last year for participating in the cover-up, the jury deadlocked 11 to 1 in favor of acquittal, and the judge declared a mistrial.

Fox partly blames politics. Jury selection for the trial came right after Donald Trump’s election. Fox says some jurors were angry that then-FBI director James Comey had reopened his investigation into Hillary Clinton just days before the vote.

"We saw jurors who were expressing distrust with the FBI, believing that the FBI and Jim Comey had something to do with the election," he says.

People had calmed down by the time of Baca's second trial in February, says Fox, who points out that he and his team also changed tactics.

They tried Baca on both obstruction of justice and perjury charges, which meant jurors heard the voice of the ex-sheriff on tape lying to the FBI.

But Fox says it was a moment during last year's trial of former Undersheriff Paul Tanaka that he may remember the most.

He asked Tanaka about a tattoo of a viking on his leg. The Vikings were a group of racist deputies at the sheriff’s Lynwood station in the 1990s.

Tanaka is appealing his convictions for obstruction of justice and conspiracy to obstruct justice. His request to remain free pending the outcome of his appeal was denied; in January he started serving a five-year sentence at a federal lock-up in Colorado.

Like many, Fox saw Tanaka as more Machiavellian than Baca, who promoted better relations with minority communities and more education programs in the jails during his tenure.

"Mr. Tanaka was more responsible for the culture issues in the department," he says. "Mr. Baca, it was more of a negligence issue for him."

Fox says the powerful sheriff's deputies union, the Association for Los Angeles Deputy Sheriffs, made his job more difficult.

"Almost every prosecution that we did, they issued a press release right afterward saying, we did the wrong thing," he says.

The resistance from the union and top sheriff’s officials raised alarms for Fox, who knew every rookie deputy is assigned first to work inside the jails.

"My concern was that if that’s the culture in the jails, that its going to bleed out onto the streets and we needed to do something to stop that culture."

Fox says the culture of impunity - reinforced by an unwritten agreement among deputies that they have each other's backs - is a problem throughout law enforcement.

"I think that’s not unique to the sheriff’s department," he says. "I think that’s something you see at police departments around the country."

Fox adds, "I think that’s changing. I hope that’s changing."

At the same time, he's concerned that Attorney General Jeff Sessions has indicated he’s open to scrapping federal oversight of some local police and sheriff’s departments.

Fox says that oversight has played a key role in reducing excessive use of force and other misconduct at departments around the country.

And he’s hoping the conviction of Lee Baca and other officials will do the same for the L.A. sheriff’s department.