Thomas J. Spota, the Suffolk County district attorney, announced his resignation on Thursday, one day after being charged with trying to derail a federal investigation into a brutal assault by his onetime protégé, the county’s former police chief.

In a brief statement, Mr. Spota said he planned to step down as district attorney “at the earliest opportunity after the resolution of normal administrative matters relating to my retirement.” Having faced scrutiny for years in the obstruction case, Mr. Spota, 76, had already said that he would not run for re-election in November.

Even though he had only a few months left in his term, Mr. Spota’s announcement brought a note of closure to his legal career. He became the district attorney in Suffolk County, a diverse jurisdiction that encompasses both working-class villages and wealthy enclaves like the Hamptons, in 2002 and initially earned praise for prosecuting corrupt local officials and leading a probe into the Roman Catholic Church’s handling of pedophile priests. But more recently, he found himself under scrutiny by federal agents who were investigating a bizarre attack on a criminal suspect carried out by his friend and the county’s police chief at the time, James Burke.

In December 2012, a heroin user named Christopher Loeb, who financed his habit by breaking into cars, broke into Mr. Burke’s car and walked off with a bag that contained sex toys and pornographic DVDs. Apparently enraged by the theft, Mr. Burke assaulted Mr. Loeb after he was arrested and shackled to the floor of a police station. The Federal Bureau of Investigation launched an inquiry into the attack, resulting last year in Mr. Burke pleading guilty to the beating and ultimately being sentenced to 46 months in prison.