Updated 8:56 p.m. ET

Suffolk County District Attorney Rachael Rollins notified the Superior Court Wednesday that she supports a motion for a new trial filed by lawyers for Sean Ellis challenging a firearms conviction linked to the 1993 murder of a police detective. If the motion is granted, Rollins said she intends to request the charges be dropped, wiping out the last case against Ellis, who spent more than 22 years behind bars for the murder before his conviction was overturned in 2015.

Following two hung juries in 1995, Ellis —19 at the time — was convicted at the conclusion of a third trial for killing Boston Detective John Mulligan, who, in the early morning hours of Sept. 26, 1993, was found slumped in his car with five bullets in the head. He had been working an overnight police detail outside a Walgreens in Roslindale. Ellis and a co-defendant were also sentenced to life on charges of robbery and for possession of two firearms, including the alleged murder weapon.

In 2015, Superior Court Judge Carole Ball determined that police and prosecutors had failed to turn over potentially exculpatory evidence to the defense that pointed to a pattern of corruption by the investigating officers.

Three years later, Suffolk County DA John Pappas decided not to retry Ellis for murder fearing that the prosecution could not win. But the firearms conviction was allowed to stand.

Several months ago, Ellis’ attorney, Rosemary Scapicchio, filed an 80-page motion for a new trialto void the lingering firearms conviction, citing multiple discrepancies in the trial and extensive discovery violations.

Rollins concurred. In her statement to the court Wednesday agreeing to the motion for a new trial she cited these problems, as well as documented evidence of corruption by Kenneth Acerra and Walter Robinson, detectives leading the Mulligan investigation.

Along with another policeman, John Brazil, Acerra and Robinson were convicted in 1998 of falsifying search warrants, among other crimes, which included stealing guns and robbing and beating drug dealers — and those whom they alleged were drug dealers.

In its decision upholding Ball’s 2015 ruling, the Supreme Judicial Court determined that the police department was aware of the investigating officers' pattern of corruption years before they were finally arrested and convicted.

The gun used in Mulligan’s execution-style murder was found by these detectives.

“In a case like this, which is tainted and infected by significant and egregious police corruption and prosecutorial misconduct, the Commonwealth must always balance ‘the necessity for preserving society's interest in the administration of justice’ against the rights of the Defendant,” Rollins wrote in her response to Ellis’ motion. “Here, both require the same result. Accordingly, the granting of the Defendant’s motion for new trial is appropriate.”

Rollins opting to side with Ellis's defense team in requesting a trial on the gun charges is raising hackles, not only among the Boston police leadership and rank and file, but also reportedly within her office among some assistant prosecutors, GBH has learned. At the time of Mulligan’s death, he was celebrated as a police hero.

In her statement to the court, Rollins acknowledged “the trauma experienced by the family of Detective Mulligan,” and said nothing can take away their pain since the murder three decades ago. “They are the unintended victims of police corruption and prosecutorial misconduct,” she wrote.

But Rollins insisted that each of Ellis’s convictions has been “irreversibly compromised.” She asked that the court allow a new trial that would then allow the commonwealth to decline to prosecute the gun charge.

“It is what justice requires,” she concluded.

Ellis said Wednesday that he was grateful for Rollins’ decision.

“The last 28 years of my life has been the Commonwealth versus Sean Ellis and me fighting to prove my name,” he said. “And so to be at a point now to have my name cleared, it's just truly emotional. And now I can get on with my life. And so, you know, I'm definitely thankful to DA Rollins.”

Ellis’ attorney, Rosemary Scapicchio, told an online forum sponsored by the New England Innocence Project said that she and her client are "thrilled at the courageous decision of Rachael Rollin's to assent to Sean's motion for a new trial."

"For the first time ever, the commonwealth of Massachusetts has taken some responsibility and acknowledged that the corruption that infected both the murder conviction and the robbery conviction also infected the firearms conviction," Scapicchio added. "But more importantly than that, it's an acknowledgment that the corruption existed and that it affected Sean's life for twenty-two years."

In a statement, the Boston Police Department agreed that corruption tainted the Ellis trial but said that evidence supporting his gun conviction was credible.

If the court agrees to a new trial and the conviction on the gun charges is dismissed, Ellis’ attorneys have indicated that they may pursue a wrongful conviction suit against the city of Boston. That could result in millions of dollars paid to Ellis as restitution for the more than two decades he spent behind bars.

Correction: An earlier version of this story misidentified the name of the organization that sponsored a virutal town hall on Sean Ellis' case. The correct name is the New England Innocence Project.

Update: Information about a potential wrongful conviction lawsuit was added after this story first published.