An 18-year-old Minneapolis man will spend nearly 17 years in prison for killing his girlfriend's 2-year-old because she wouldn't stop crying, under a sentence delivered Tuesday.

Cody Feran-Baum pleaded guilty earlier this year to second-degree unintentional murder in the death of Sophia O'Neill. He didn't speak at the sentencing but appeared unsteady enough that Hennepin County Judge William Koch asked if he needed to sit down.

Feran-Baum, who wore an orange jail outfit, had his back to spectators in the small courtroom. At one point, he was given a tissue.

Koch sentenced him to 25 years but said he will serve just shy of 17. The judge said to the defendant, "You have an opportunity to try to improve yourself."

Feran-Baum had agreed to the sentence as part of his plea, even though it was significantly longer than a person without a criminal history could expect. It was longer than usual because the beating was so severe that Hennepin County Attorney Mike Freeman called it torture.

Before the sentence was delivered, the prosecutor read victim-impact statements from the child's paternal grandmother and great-grandmother.

One said, "Get your education. … Become a better man."

Feran-Baum's lawyer, Bobby Joe Champion, told the court that "there are no words that can be articulated that can heal the family."

He noted that Feran-Baum was always tearful about his crime and had no words to express how sorry he is.

Feran-Baum, who was 17 at the time of the crime, had admitted that he was alone in his grandmother's house at 3857 30th Av. S., Minneapolis, when he became frustrated with Sophia's crying.

She didn't stop after he gave her food and put her in a timeout, so he said he kicked her in the back more than once and stepped on her.

When he saw that Sophia was slipping away, he gave her a bath. When that didn't seem to help, he ran next door and told a neighbor to call 911.

After the hearing and outside the courtroom, Freeman said that Feran-Baum lacked the skills and temperament to care for the child.

"The criminal justice system ends up with tragedy after tragedy. What I can assure people is we're doing everything we can" to protect children, he said.