Suffolk County DA Thomas Spota announced Thursday that he is retiring — just a day after pleading not guilty in a police-brutality coverup involving a former top cop’s stolen sex toys and porn stash.

Spota’s chief assistant, Emily Constant, will take over until an election next month determines the next DA.

“I will be leaving my post as District Attorney at the earliest opportunity after the resolution of normal administrative matters relating to my retirement,” Spota, 76, said in a statement.

Spota, who was first elected in 2002, is stepping down amid accusations that he tampered with FBI witnesses to help a police-chief crony escape justice in a series of crimes and coverups that started with the theft of a certain duffel bag.

The bag had been stowed inside the vehicle of then-Suffolk Police Chief James Burke and contained cigars, porn DVDs, and sex toys, including a fake penis.

In December 2012, the police chief’s car was broken into and the bag stolen by Christopher Loeb, a petty thief with a $100-a-day heroin habit, according to federal prosecutors.

Loeb was arrested, shackled to a precinct-house floor and interrogated personally by the police chief, a Spota protege.

During the interrogation, Loeb taunted the police chief in front of other detectives, citing the duffel bag contents and calling him a “pervert.”

Burke “went out of control,” prosecutors said, savagely beating the shackled prisoner and threatening him with death.

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

Then came the coverup that eventually, prosecutors say, encompassed the DA himself.

Burke pressured the detectives who watched the assault to keep quiet, the feds said.

And according to the indictment unsealed Wednesday, Spota and his anti-corruption bureau chief, Christopher McPartland, repeatedly conspired with Burke to thwart the feds’ investigation.

The indictment accuses Spota and McPartland — who also pleaded not guilty Wednesday — 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 sentenced last year to 46 months in federal prison for the coverup and the assault on Loeb.

Spota, through his attorney, Alan Vinegrad, has insisted he is innocent.