A Long Island jury on Tuesday found former Suffolk County District Attorney Thomas Spota guilty of obstructing a federal probe into a police chief who bashed a handcuffed prisoner over stolen porn.

The jury found Spota and Christopher McPartland, the ex-chief of the DA’s anti-corruption unit, guilty on charges of obstruction, witness tampering and conspiracy following a six-week trial and two days of deliberations.

The 78-year-old Spota, who served as DA for more than a decade until he stepped down in 2017, and McPartland both face up to 20 years in prison when they return to court for sentencing.

In late 2012, Chistopher Loeb, who was at the time supporting a $100-per-day heroin habit, was busted for swiping property from Suffolk Police Chief James Burke’s police-issued SUV — including a “party bag” containing sex toys and porn DVDs.

During Burke’s interrogation of Loeb, the suspect taunted the police chief in front of other detectives about the contents of the duffel bag and called him a “pervert.”

Burke — a protege of Spota’s who had risen quickly through the ranks with the DA’s help — “went out of control,” prosecutors said, savagely beating the shackled prisoner and threatening him with death.

“Boss, that’s enough,” one of the detectives present interceded, according to prosecutors.

Over the next three years, as the feds began digging into the incident, Spota maneuvered to keep Burke out of jail, instructing the detectives who witnessed the beating to keep quiet about what they saw.

Spota and McPartland were accused of pressuring unnamed witnesses to lie to the feds and give false testimony under oath, including by withholding information from a grand jury.

Burke was eventually convicted of beating Loeb and was sentenced to 46 months in prison. He was put on home confinement last year.

Following Tuesday’s verdict, Suffolk County Executive Steve Bellone, who called for Spota to resign in 2016, said in a statement that the ex-DA took part in “covert spying, threats made against perceived enemies, relentless intimidation tactics, and outright fear.”

“At the time I called for his resignation, Tom Spota’s power was at its peak and their criminal enterprise was in full swing,” Bellone said. “This culture of corruption has had a real and profound impact. They ruined lives and destroyed careers.”

Suffolk County Police Commissioner Geraldine Hart issued a statement saying the verdict “sends a clear message that no one is above the law.”

“The actions of former District Attorney Thomas Spota and his Chief Aide Christopher McPartland go against everything that this department stands for and it is unfortunate that their illegal activities could cast a negative light on the public’s perception of this police department,” Hart said.

“Instead of supporting the proud men and women of this department, this trio focused on corruption and cover-ups.”

Larry Krantz, McPartland’s defense attorney, said he is disappointed with the verdict and insisted it was “not supported by the credible evidence at trial.”

“We will continue to pursue the legal fight for Chris McPartland, who has steadfastly maintained his innocence on these charges,” Krantz said.