A teenager who murdered a 15-year-old boy was detained for life after a judge ruled that he committed "a particularly heinous crime," and reoffending is a real danger if he comes out of jail.

The boy, who cannot be named under Queensland law, killed a high school student in a random knife attack at a shopping plaza.

In the Supreme Court in Brisbane on Monday, Justice Ann Lyons said the convicted teenager, now 18, had shown no remorse over his act, which is a murder in calculated cold blood, News.com.au reports.

Justice Lyons said the victim's family had been devastated and remained very distressed about the murder.

"I find this is a particularly heinous crime and it is in the worst category," she said.

She sentenced the teenager to life detention, which will be served in an adult jail after he turns 19 in January, according to News.com.au.

At the time of the murder, the teenager was on probation over attempted rape of two other boys when he was 13 years old.

Barrister Katarina Praskalo, counsel for the convicted teenager, said her client had a mental illness, and should be sentenced to 14 years detention because of his guilty plea and admissions made before the police.

Prosecutor Brendan Campbell told the Supreme Court in Brisbane the victim was a 15-year-old boy who was known as a "gentle soul" and had been on his last day at the James Nash High School in Gympie.

The convicted teenager had just left home after getting a strong reprimand from his mother and unleashed his anger on the victim in a random attack.

Campbell said a series of psychiatric reports revealed the teenager was a "very high risk of reoffending" and had fantasies about "violent and sadistic knife attacks on males."

"He is a highly dangerous person," Campbell said.