T.J. Lane unbuttons his shirt during sentencing Tuesday, in Ohio, to reveal a t-shirt that reads, “KILLER.”

CHARDON, Ohio — Wearing a T-shirt with “killer” scrawled across it, smirking and gesturing obscenely, a teenager was given three life sentences without parole Tuesday for opening fire last year in an Ohio high school cafeteria in a rampage that left three students dead and three others wounded.

T.J. Lane, 18, had pleaded guilty last month to shooting at students in February 2012 at Chardon High School, east of Cleveland. 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.

Lane was defiant during the sentencing, smiling and smirking throughout, including while four relatives of victims spoke.

He calmly unbuttoned his blue dress shirt to reveal the T-shirt reading “killer,” which the prosecutor noted was similar to one he wore during the shooting.

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

“The hand that pulls the trigger that killed your sons now masturbates to the memory,” he said, then cursed at and gestured obscenely toward the victims’ relatives.

Dina Parmertor, mother of victim Daniel, called Lane “a pathetic excuse for a human being” and wished upon him “an extremely, slow torturous death.” She said she has nightmares and her family has been physically sick over the crimes.

“From now on, he will only be a killer,” she said, as Lane’s smile widened. “I want him to feel my anger toward him.”

Prosecutors say Lane took a .22-caliber 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 at Chardon waiting for a bus to the alternative school he attended, for students who haven’t done well in traditional settings.

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

He faced a maximum sentence of life in prison without parole. 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.