A 17-year-old boy who wanted to “shoot up a mosque” and kill 10,000 people has been given a youth rehabilitation order.

The teenager, from Wiltshire, was given the 24-month order at Southampton Youth Court after pleading guilty to possessing material likely to be useful to a person committing or preparing an act of terrorism.

He was ordered to pay a £22 court surcharge.

A spokesman for Counter Terrorism Policing South East (CTPSE) said: “The boy had made numerous racist comments in online forums and had talked about wanting to kill Muslims by ‘shooting up a Mosque’.

“This was reported by concerned members of the public online, which resulted in the boy being initially arrested on 18 June for racially/religiously aggravated malicious communications.

“During the search of a property, detectives uncovered a handwritten note titled ‘The Big Plan’.

“This contained details of how to make a bomb, a number of named locations and individuals who were believed to be aspirational targets, and an intention to kill in excess of 10,000 people.”

Detective Chief Superintendent Kath Barnes, head of CTPSE, said: “It is never a cause for celebration when we see someone so young falling foul of such hatred.

“What we have seen with this case is (that) someone trusted their gut instincts.

“Having read the vile racist abuse online, they chose to ACT; they contacted the Anti-Terrorism Hotline and shared their concerns with us and as a result we were able to intervene before the situation escalated any further.

“I know this case may be concerning to certain members of the community who were the target of the atrocious hatred.

“We have seen an increase in the proportion of our investigations from the threat from extreme right-wing terrorism who wish to cause harm in our communities.

“We take that threat very seriously and this is why the whole of the CT community, as well as the whole of society, has a role to play in tackling it.”

Wiltshire Police’s Assistant Chief Constable, Deb Smith, said: “I hope that our communities feel reassured that we acted swiftly, in conjunction with our partners, to ensure that this individual was detained and could no longer pose a risk to the wider public.”