CHARDON, Ohio -- Wearing a T-shirt with "killer" written on it, a teenager cursed and gestured obscenely as he was given three life sentences Tuesday for shooting to death three students in an Ohio school cafeteria.

T.J. Lane, 18, had pleaded guilty last month in the February 2012 shooting. Investigators have said he admitted to the shooting but said he didn't know why he did it.

Before the case went to adult court last year, a juvenile court judge ruled that Lane was mentally competent to stand trial despite evidence he suffers from hallucinations, psychosis and fantasies.

After Lane came into the courtroom, he unbuttoned his blue dress shirt to reveal the T-shirt reading "killer," which the prosecutor noted was similar to the one he wore during the shooting.

At one point, he suddenly swiveled around in his chair toward the gallery where his family members and those of the slain teenagers were sitting.

"The hand that pulled the trigger that killed your sons now masturbates to the memory," he said, then cursed at and raised his middle finger toward the victims' relatives.

One of Lane's defence attorneys, Ian Friedman, said he was caught off-guard by the comments. The defence had signalled earlier that Lane wouldn't speak in court.

Prosecutors say Lane took a .22-calibre pistol and a knife to the school and fired 10 shots at a group of students in the cafeteria. Daniel Parmertor and Demetrius Hewlin, both 16, and Russell King Jr., 17, were killed.

Lane was there waiting for a bus to the alternative school he attended, for students who haven't done well in traditional settings.

Dina Parmertor, mother Daniel, called Lane "a pathetic excuse for a human being." She said her family has been physically sick over the shootings.

"From now on, he will only be a killer," she said, as Lane's smile widened.

Lane had pleaded guilty last month to three counts of aggravated murder, two counts of attempted aggravated murder and one count of felonious assault.

Life imprisonment without parole was the maximum sentence Lane faced. He wasn't eligible for the death penalty because he was 17 at the time of the shootings. Relatives of the slain students indicated earlier they wanted Lane to get the maximum sentence.

Lane's sister, Sadie, was in the cafeteria the day of the shooting. She said the brother she saw in court wasn't the one she remembers.

"It may be hard for some to understand, but I love my brother and hope that whatever the sentencing in life takes him in the future, that he can touch others' lives in a positive way from the point of view that only he can give," she said.