As three generations of his family watched, a man once described by police as an "engine for violent crime" won praise for his parenting from a Baltimore judge even as she sentenced him for his part in a shooting that left one of his friends dead.

Judge Wanda K. Heard invited Stanley Brunson, 36, to tell his 16-year-old son to stay away from the life of the streets that had landed him before her Tuesday. Brunson turned and mumbled a warning to the teenager.

"That's your father talking to you," Heard said. "He knows what he's talking about."

Heard added that she was impressed by accounts in court records of how he had raised his children.

But Heard handed down a sentence of 20 years in prison for a first-degree assault conviction and two gun charges. Brunson's mother burst into tears as the punishment was announced.

The family drama played out at the end of what Assistant State's Attorney Traci Robinson called "a classic Baltimore city trial" set against a wave of violence in Southwest Baltimore two winters ago.

In December 2011, Brunson opened fire on another man he encountered in the street. The shooting was an attempt to avenge his own injuries from a shooting just days earlier, according to prosecutors. The intended target was wounded in the attack, but Brunson also hit his friend Donte Collins — perhaps because Brunson's arm was weak after being shot, Heard said — who soon died at Maryland Shock Trauma.

Police Commissioner Frederick H. Bealefeld III singled out Brunson at the time, describing him as a "legend" in his neighborhood for beating previous charges.

Brunson's lawyer, Gil Amaral, unsuccessfully argued that his client should have a new trial because the conviction was not supported by the evidence.

The judge accepted that Brunson did not mean to kill Collins and said he should be offered bereavement counseling in jail to help him deal with his friend's death.

"Regardless of what I do … that's something he's going to live with," she added.

iduncan@baltsun.com

twitter.com/iduncan