A judge has sentenced a teenager to life in prison for killing an 1-year-old boy by repeatedly swinging him against a wall because he was frustrated with the child's toilet training.

Hamilton County Common Pleas Judge Beth Myers sentenced Derris Smith, 18, on Tuesday, stipulating he is not eligible for parole for at least 31 years. A jury convicted Smith on charges of murder, felonious assault and child endangering.

Authorities said Smith, the mother's boyfriend, repeatedly slammed Malakai Glenn against the wall when he became frustrated last June while trying to toilet train him. The impact left drywall stuck to Malakai's head and cracked a wooden door, said the boy's mother, Sasha Glenn, 20.