With potential jurors waiting outside the courtroom, a Baton Rouge man whose 2014 second-degree murder trial ended in a hung jury pleaded guilty Monday to manslaughter in return for a 27-year prison sentence in a 2007 fatal shooting.

Ernie Jacobs, 28, was given credit for the years he has spent in jail since his arrest and probably will serve another 13 years behind bars, his attorney Bo Rougeou said.

“It’s a long time, but it’s not as long as life,” Rougeou said, referring to the penalty for a second-degree murder conviction. Manslaughter is punishable by up to 40 years in prison.

East Baton Rouge Parish District Attorney Hillar Moore III said the Nov. 21, 2007, killing of 25-year-old Jonathan Dixon, of Baton Rouge, on Fairfields Avenue was originally a capital murder case that consumed hundreds of hours of motions and hearings and many attorneys.

“We are pleased with the terms of the sentence and glad to finally have this matter concluded for the victim’s mother, who has been involved in the judicial process from the beginning,” Moore said.

State District Judge Mike Erwin, who sentenced Jacobs, declared a mistrial in Jacobs’ January 2014 trial after jurors could not reach a verdict.

Jacobs’ co-defendant, Brian Sanders, 28, pleaded guilty in 2013 to attempted second-degree murder and is scheduled for sentencing March 17.

Prosecutor Mark Pethke said Sanders and Jacobs, both of whom were armed, went to barber Eric Taylor’s home to rob him. Taylor was cutting Dixon’s hair at the time, and the two were ordered to go into the house, authorities have said.

Pethke said Dixon was at the wrong place at the wrong time.

Taylor was robbed and fled to another room, dodging gunshots aimed at him. Dixon was shot several times.

About $200 was taken during the robbery, an arrest warrant stated.