A 14-year-old boy from Lancashire – dubbed Britain’s youngest terrorist – was within days of successfully orchestrating a terrorist attack on an Anzac Day parade in Australia, prosecutors have told a court.

From his bedroom in his parents’ suburban house in Blackburn, the teenager, now 15, became an “organiser and adviser” to an Australian jihadist who also wanted to behead police officers in Melbourne, Manchester Crown Court heard. However the defence insisted the defendant, who cannot be named because of his age, had felt isolated because of degenerative eye condition and problems at school and home after his parents separated.

Just two weeks after creating a Twitter account and posting extremist messages, he had 24,000 followers and “quickly became a celebrity” among the jihadi community, defence lawyer James Pickup QC said. This new-found popularity “filled a void” in the teenager’s life, he added.

The youth, who sat in the court flanked by his mother and father, has pleaded guilty to inciting terrorism overseas and is due to be sentenced today. Paul Greaney QC, prosecuting, told a sentencing hearing that the defendant had exchanged more than 3,000 encrypted messages with the Australian jihadi Sevdet Besim, after prompting by an Isis recruiter and propagandist called Abu Khaled al-Cambodi.

“There is no doubt that there was a determination on the part of the defendant and Sevdet Besim that the plot should be carried through and the contact between the two included frequent references to the production of a martyrdom video by Besim for Cambodi which, no doubt, Cambodi intended to use for propaganda purposes,” Mr Greaney said.

“In the event, fortunately, the authorities here and in Australia intervened and a plot that would in all probability have resulted in a number of deaths was thwarted.”

The court heard the boy, described as a “troubled young person” from the age of 12, was twice referred to a government scheme designed to discourage violent extremism. He was regularly excluded from schools in Blackburn and Burnley for being persistently abusive and disobedient.

In one class he was reported to have told a teacher, “You are on my beheading list”.

A male teacher was threatened on “many occasions” and once the teenager said that he would “cut his throat and watch him bleed to death”.

Mr Greaney said by March this year teachers were “increasingly concerned for their own personal safety and the evidence of [the defendant’s] radicalisation was overwhelming”.

The boy also praised Osama bin Laden and said he regarded the two men who killed 11 people at the offices of Charlie Hebdo in Paris in January as “his heroes”.

Mr Pickup, defending, said the youth had been welcomed by the online jihadi community. “He was accepted. He wasn’t rejected,” he said.