Four years later, after an investigation by federal agents, Mr. Burke pleaded guilty to having beaten Mr. Loeb after he was arrested and shackled to the floor of a police station. Last year Mr. Burke was sentenced to 46 months in federal prison for assaulting Mr. Loeb and for trying to orchestrate a cover-up of what had happened.

In an indictment unsealed on Wednesday in Federal District Court in Central Islip, N.Y., federal prosecutors accused Mr. Spota, 76, and Christopher McPartland, 51, one of the district attorney’s top deputies, of participating in that cover-up. Federal prosecutors accused them of holding a series of meetings and phone conversations with Mr. Burke and other police officers in which they agreed to conceal Mr. Burke’s role in the assault and to impede the federal investigation.

Mr. Spota remains in office, but he had already announced that he would not seek re-election in November. Mr. Spota has been district attorney since 2002, and he initially earned praise for pursuing corrupt officials in local towns, and for spearheading an inquiry into how Roman Catholic Church officials on Long Island had protected pedophile priests.

Mr. Spota and Mr. Burke had been close for years. They met in the late 1970s, when Mr. Burke, then a teenager, was the star witness in a murder case involving a 13-year-old boy whose body was found with six rocks jammed down his throat. Mr. Spota, then an assistant district attorney, prosecuted the case.

Mr. Burke went on to become a police officer, and after Mr. Spota was elected district attorney he brought Mr. Burke to his office as a top investigator, and later pushed him as a candidate to become the top uniformed officer on the county police force, which is overseen by a civilian commissioner. With Mr. Spota’s backing, Mr. Burke became the chief in 2012.