Moments after a Suffolk County jury acquitted a Dorchester drug dealer and gang member of first-degree murder, Judge Kenneth Desmond looked at the defendant, who was still shaking with relief, and urged him to step away from violence and crime.
"It's not for me to tell you what's going on [in the streets]. You know better than me," Desmond told 26-year-old Peter Carvalho on Friday afternoon. "You're fortunate to have another chance. . . . I hope you have an opportunity to do something with your life. . . . Good luck."
A jury deliberated for three hours before acquitting Carvalho, who was accused of shooting Shannon Richardson, his best friend and a fellow gang member, during an apparent confrontation with rivals on a Dorchester street on May 21, 2014.
As jurors pronounced him not guilty of the charges against him, Carvalho blessed himself repeatedly. His sisters beamed and pumped their fists.
Richardson's mother, who sat in the front row, began weeping and had to be carried out of the courtroom by a male relative. Jurors looked startled as they heard her wails from outside the courtroom.
During the two-week trial, prosecutors told jurors that Carvalho, a Wendover Street gang member, fired a gun six times at Richardson — bullets that they suggested were meant for their rivals. But the defense said it was the rivals in the Homes Avenue gang who attacked and struck Richardson.
The Wendover-Homes gang rivalry in Roxbury is historically one of the most violent in Boston, and such feuds often lead to spikes in shootings and killings on city streets. The trial highlighted not only the friction between the two groups but also their tension with police, who often struggle to gain gang members' cooperation because of a culture that frowns on helping law enforcement.
Richardson was shot in Uphams Corner in the middle of the afternoon, then fled to a store on nearby Dudley Street, where police quickly found him and Carvalho, who was leaning over Richardson as he lay bleeding.
Carvalho was charged with murder after two witnesses said he fit the description of the shooter — a man in a white T-shirt with dreadlocks.
But the case against Carvalho was difficult.
Police never found the firearm, believed to be a 9-millimeter handgun, and there was no gunshot residue on Carvalho's clothes or his hands, even though he was taken into custody almost immediately after the killing last year. The bulk of the case rested on two men who said they saw a man in dreadlocks shoot Richardson, but during the trial, one of those men said he could not identify Carvalho as the shooter.
Carvalho's defense lawyer, Kelli Porges, said during her closing argument that the witnesses pointed to Carvalho as the shooter only after police showed him in a lineup with other men —
Porges described the lineup as "offensively suggestive."
Porges said Richardson and Carvalho were together that afternoon. They became separated as they fled from two cars filled with gang rivals who were circling their neighborhood.
After the shooting, Carvalho rushed to the store to be by Richardson's side.
During her closing argument, Porges asked the jury to consider why a man who had just shot someone would return to a scene swarming with police.
"He didn't go home. He stays," Porges said. "This scene was like Fort Knox within moments."
While police interrogated a distraught Carvalho, Porges said, Homes Avenue gang members were drinking cocktails at Boston Bowl in Dorchester.
In a statement, a spokesman for Suffolk District Attorney Daniel F. Conley said prosecutors stand by their assertion that Carvalho was responsible.
"Although the case presented major challenges, we believed the facts, evidence, and law supported a conviction," said Jake Wark, Conley's spokesman. "Our thoughts now are with Richardson's loved ones."
During the trial, Suffolk Assistant District Attorney Tara Burdman said the testimony of the two eyewitnesses was compelling because they agreed on a crucial fact — there was only one man in the path with Richardson that afternoon.
There was no evidence that it was rivals in a car who shot Richardson, Burdman said.
The tension between Carvalho and police continued after the jury rendered its verdict.
Once the jurors had filed out, Carvalho turned to look into the gallery. He stared pointedly at the grim-looking homicide detectives who sat in the front row. Then he gave them a slight smile.
Maria Cramer can be reached at maria.cramer@globe.com.
