Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

This week a series of small-town sheriff’s officers took the stand in a federal courtroom in Louisiana and testified to brutal, racist scenes that seemed like relics from another era.

After drinking, three off-duty officers beat up two young black men for fun, one testified.

Later, when the sheriff found out, he said it simply sounded like a case of "n****r knockin'," another testified.

A supervisor pointed to a stain on the floor next to an interrogation suspect and said, "That’s from the last n****r I shot," one officer testified.

A witness also testified that the sheriff ordered pre-trial detainees into his jail’s chapel, away from the eyes of surveillance cameras, where they were beaten and pleaded for mercy.

The facilitator of such brutality, they said, was Sheriff Louis Ackal, the tough-talking sheriff of Iberia Parish, a rural swath of sugarcane fields about two hours outside of New Orleans. This week, in the culmination of a years-long, wide-ranging federal probe of his office, Ackal was tried on four federal civil rights violations in Shreveport.

On late Friday afternoon a jury acquitted Ackal of all charges.

"I’m elated," Ackal said after the verdict, while hugging the president of the NAACP’s New Iberia chapter. "I thank the Lord almighty."

"Thank God we had a jury that listened," he added.

Sheriff Louis Ackal headed to lunch with New Iberia chapter NAACP President, Geri Brown, as jury deliberates. pic.twitter.com/nkeRoXagu0 — Dalfred Jones (@DialDalfred) November 4, 2016

It was a dramatic turn in a civil rights case that centered on shocking allegations of racism and abuse perpetrated by a rural law enforcement agency that prosecutors characterized as out of control.

The historic probe of Ackal and the Iberia Parish Sheriff’s Office has thinned the ranks of the already small law enforcement agency. Ten of his former deputies, including a high-ranking supervisor, have pleaded guilty to federal civil rights violations, and more than 100 criminal cases involving those deputies have been tossed as a result of the probe. The probe stretches back to 2008, during Ackal’s first term in office.

NBC News has reported on the sheriff and his jail. In 2014 NBC News investigated the death of Victor White, a 22-year-old black man who died from a gunshot wound while handcuffed in the back of an Iberia Parish patrol car. The district attorney declined to press charges in the case and a coroner’s report ruled the death a suicide. Last year, in partnership with the Louisiana newspaper The Advocate, NBC News published troubling video of a black inmate allegedly being assaulted by a white correctional officer and his dog during a contraband sweep in the jail. The officer involved in that incident has not been charged with a crime. Two of the charges filed against Ackal revolved around violence inflicted upon detainees.

Related: Shocking Jail Video Shows Guard and Dog Attacking Prisoner

Related: Handcuffed Black Youth Shot Himself to Death, Says Coroner

The federal government’s case against Ackal, which unfolded this week in Louisiana’s Western District federal court, alleged that the sheriff ordered deputies to rough up his personal enemies and encouraged the assault of inmates and individuals in custody. He was also accused of covering up evidence. The testimony offered by deputies who say Ackal once protected them was dramatic.

"A case of n****r knockin'"

In their opening statements, prosecutors painted a portrait of a law-enforcement agency run amok, accusing the three-term elected sheriff of witnessing and encouraging beatings and ordering the destruction of all his agency’s internal affairs records.

Ackal was charged with one count of conspiracy against rights, two counts of deprivation of rights, and one count of conspiracy to abuse and obstruct.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

According to reporting by Richard Burgess of The Advocate, on the second day of testimony Jason Comeaux, who pleaded guilty to several charges including conspiracy and deprivation of rights, said he and other agents were protected by Ackal, and directed to use excessive force against residents of majority-black neighborhoods in an effort to “clear the streets.” He also said he and others were instructed by superiors to lie about incidents, including in depositions.

Comeaux testified that after officers got drunk at a party and decided to find people to beat up, they targeted two young black men on the street, aged 16 and 21. After their assault was discovered, Ackal "was mad because they got caught and there was a report written on it," Comeaux said.

Federal prosecutor Joseph Jarzabek, in his opening statements, said that Ackal later deleted the report. Former deputy Wade Bergeron, who participated in the beatings, testified that when he told Ackal, "His remark was it sounds like a case of n****r knockin.'"

Sheriff Ackal denied the charges against him. His attorney, John McLindon, said in court that the case against Ackal relied on testimony by deputies who are still awaiting sentencing. He called it "paycheck prosecution," according to The Advocate.

Sheriff Louis Ackal of Iberia Parish, Louisiana was acquitted on all charges in a federal civil rights trial.

During three days of testimony prosecution witnesses described a law enforcement agency rife with racism and a jail plagued by violence. Officers referred to black residents as "animals," according to testimony. Beatings were commonplace. According to the indictment, Comeaux told a personal enemy of a supervisor, who was shackled and punched by agents, to lick his own blood spatter off the wall. One deputy testified that a supervisor pointed to a stain on the floor next to an interrogation subject and said, "That’s from the last n****r I shot."

Comeaux and other deputies also testified to Ackal ordering abuse, including an April 2011 incident in the parish jail, when detainees were brought into the jail’s chapel and beaten with batons by deputies.

"The only thing I’m gonna give you, f***ing shoot you right between your g*****n Jewish eyes."

"He (Ackal) was the boss and he ordered it and he came in with us," Comeaux said.

Another former deputy testified that narcotics agents regularly used excessive force against black residents. Deputy Ben Lassalle said agents would travel to a "predominantly black part of town" and beat people up "for pretty much no reason."

Both Lassalle and Comeaux pleaded guilty to charges stemming from beating inmates.

In his testimony, Lassalle said the culture gave him "a sense of power."

"It didn’t bother me," he said. "We all just got used to it."

"Not Mayberry"

Ackal did not take the stand. In opening statements Ackal’s attorney, McLindon, said that deputies were merely trying to get in the good graces of prosecutors.

"Sheriff Ackal is not Andy Griffith, but Iberia Parish is not Mayberry," he said. Deputies, he said, used allegedly pervasive racism in the parish "as a license, in their minds, to justify their illegal behavior."

On the final day of his trial, Ackal’s defense called several witnesses, including an inmate whose beating was at the heart of the case against the sheriff. The inmate said he did not see Ackal when he was being beaten, according to his testimony, only when he was taken away. Black employees also testified that the sheriff treated them well, according to The Advocate.

Before his trial began, Ackal was secretly recorded making threats against federal prosecutor Mark Blumberg, according to court filings. A transcript of the conversation shows Ackal threatening to shoot the prosecutor, who is special litigation counsel assigned to the Civil Rights Division in Washington, DC.

"He told me ah, you can help the government," Ackal was recorded saying to an unidentified person. "You know about these people, you can give them to us."

"I said, ‘The only thing I’m gonna give you, f***ing shoot you right between your g*****n Jewish eyes, look-like-an-opossum bastard,’" Ackal said.

Ackal also called the prosecutor a "sorry son-of-a-b**** Jew bastard in Washington."

"They did it to my son"

The father of the man who died from a gunshot wound in the back of a parish patrol car in 2014 said he watched in anger as Ackal spit chewing tobacco into a Styrofoam cup in the courtroom during testimony this week.

The testimony, Victor White Sr. said, "validated everything that he was hiding and the things that we knew."

He and his wife drove the nearly two hours from their home in Alexandria, they said, to see Ackal and his deputies face to face. No charges were ever filed against the Sheriff’s Office in their son Victor’s case, and an autopsy report ruled his death a suicide. But the White family has never believed the official story.

"I wanted to go sit there and look at him, face to face, and let them say they didn’t do those types of things," White said.

When he heard the verdict, he said, he felt sick.

"Bottom line is, he knew what was going on," White said.

After court Ackal said he was "totally exonerated" and those who testified against him "lied about the whole thing."

The probe of his office, he said, eliminated bad actors from his law enforcement agency who hurt "innocent people."

"I’m going to go back to New Iberia and make sure my house is very clean," he said.

"It shook me to the core" to hear the deputies' testimony, he added. "I guess it's because I’m very nice."