The fourth and final man linked to the 2010 slaying of well-known D.C. principal Brian Betts was sentenced to 27 years in prison Friday as the tragic case wound to a close.

Sharif Lancaster, who had previously pleaded guilty to robbery and a handgun charge, showed little emotion as he was led out of court. The 21-year-old has been incarcerated since his arrest in the case more than two years ago. As for his three accomplices, triggerman Alante Saunders was sentenced to 40 years in prison, Deontra Gray to 30 years and Joel Johnson to 18 months. In September, after his release, Johnson was killed in the District after he forced his way into an apartment and was shot in the head, authorities said.

Betts’s sister and mother attended Friday’s sentencing, and afterward they said Lancaster — who had a troubled childhood and a history of run-ins with the law — was just the type of kid that Betts had a knack for straightening out.

“Sometimes, Brian believed in them before they believed in themselves,” the victim’s mother, Doris, said.

On April 15, 2010, after Betts didn’t show up to work at Shaw Middle School at Garnet-Patterson, co-workers went to check on him at his Silver Spring house. They found his door unlocked and called police, who arrived to find Betts dead in an upstairs bedroom.

The night before, Saunders had gone on a sex chat line looking for a victim. He spoke to Betts and set up a meeting with him as a ruse to rob him. All four — Saunders, Gray, Johnson and Lancaster — went to Betts’s house.

Lancaster spoke at his sentencing, apologizing to Betts’s sister and mother. He said Betts’s death eats away at him every day. Lancaster told Montgomery County Circuit Court Judge Eric Johnson that when he gets out of prison he will stay out of trouble. “I just don’t have it in me anymore,” he said.

Prosecutors painted a different picture of Lancaster. He was a member of the “Let’s Work Crew,” a street gang, and had been given many chances to turn his life around, said Assistant State’s Attorney Mary Herdman.

State sentencing guidelines in the case, which are not binding on judges, called for a range of eight to 15 years, according to Lancaster’s attorneys.