A Dorchester man convicted of first-degree murder for riddling a Boston Police Detective with bullets in a Walgreens parking lot 22 years ago will get a new trial after a Suffolk Superior Judge said that authorities withheld evidence from the defense.

In 1995, Sean Ellis, 19 at the time, was convicted of shooting Detective John Mulligan five times in the face and stealing his service weapon while Mulligan slept in his car working a security detail in Roslindale. Terry Patterson, Ellis’ co-defendant, pled guilty to manslaughter charges but was freed from prison in 2007 after the Massachusetts Supreme Court discredited evidence against him.

Judge Carol Ball set a $50,000 bail for Ellis and required he wear a GPS device should he post bail. The Commonwealth opposed the decision, noting that Ellis was found with the deceased detectives Glock 9mm.

“I worry that my decision in this case, which of course I stand by, is not meant to impugn the reputation of the honorable police officers involved in this case, specifically Sgt. Detective O’Leary,” Ball said. “Having said that, I feel strongly that Mr. Ellis did not get a fair trial.”

Ellis’ defense claim that they were not given access to vital information regarding a tip from a BPD officer accused a fellow officer of killing Detective Mulligan. Scapicchio said that the Commonwealth mishandled the information about the tip, first by indicating that the tip did not come from within the Boston Police, then by claiming that they had handed over the information to the defense team. Judge Ball found this to be untrue.

Three Boston Police Detectives, Walter Robinson, Kenneth Acerra and John Brazil, who played key roles in arresting Ellis, were accused of running a rip-and-run operation. Mulligan and another detective were said to have robbed a Brighton drug dealer 18 months before Mulligan’s death. Acerra and Robinson plead guilty to corruption charges in 1999 and John Brazil was granted immunity for his cooperation after it was discovered that they were.

“The idea that these were members of the Boston Police Department committing felonies, kidnapping people, robbing them at gunpoint, stealing their money, lying about it, pretending they had search warrants when they didn’t is against what Boston police officers are supposed to do,” Defense Attorney Rosemary Scapicchio said. “I believe they absolutely betrayed their fellow officers. Every aspect of this case was tainted by their conflict of interest.”

Scapicchio said that overseers at the BPD should have at least been aware of the criminal activities Mulligan and the other detectives were involved in. She sand that Accera’s niece identified by Ellis as the man kneeling near Mulligan’s car and that she initially identified another man before talking with Accera. Scaphicchio said that Ellis went to the Walgreens to buy diapers and left the scene a half hour before the murder took place.

“Sometimes when you’re anxious to close a case, mistakes get made,” Scapiccio said. “In addition, you had at least three police officers trying to cover their own asses. They were trying to make sure that none of their own criminal activity was discovered.”

The pre-trial date was set for May 5, 2015.