LONDON (AP) — A 15-year-old British boy was sentenced Friday to at least five years in custody for organizing a terrorist plot to kill police officers in Australia.

Judge John Saunders said the teenager, who can't be named because of his age, would only be released when he was no longer a danger to the public. He handed down a life sentence with no chance of parole for five years.

Prosecutors say the boy planned the Islamic State group-inspired attack from his suburban bedroom in Blackburn, northwestern England. He sent thousands of online messages to 18-year-old Australian Sevdet Besim, developing a plot to run over or behead police officers at a war memorial parade in Melbourne.

The teenager, who was 14 when he was arrested in April, admitted inciting terrorism and is one of Britain's youngest convicted terrorists.

Besim is awaiting trial in Australia.

Passing sentence at Manchester Crown Court, Saunders said it was "chilling" that a 14-year-old could become so radicalized that he wanted to kill. He said older recruiters had groomed the boy online, turning him into "a deeply committed radical extremist."

"Thanks to the intervention of the police in this country and in Australia, that attack and the deaths which were intended to follow never happened," the judge said.