"He said his mind was in a state of hatred which couldn't be repaired," she said.

Mrs Nicholls recommended that he was referred to Child and Adolescent Mental Health Services (CAMHS) by his GP.

"Stephen found it very hard to talk about his concerns," she said. "We felt we needed some expert help beyond the school."

Mrs Nicholls said Stephen increasingly talked about suicide, told staff he was going to kill them and became less co-operative and more defiant.

He became fascinated by school massacres and would write about them in his journals.

After he told teachers he would bring a gun and knife to school to kill people, it was agreed that his parents would check his bag each morning.

"We were very alarmed by his behaviour," Mrs Nicholls said. "We took him very seriously."

That April the autism teacher in school said Stephen was an "immediate safeguarding issue" due to his obsession with the "dark web".

Following a playground altercation with other pupils last May, which involved Stephen holding a sharp piece of wood, along with a corridor incident on the same day during which Stephen told a teacher he wanted to jump out of the window to kill himself, Stephen was given a five-day exclusion from school.

"We decided a short fixed-term exclusion was the best thing," Mrs Nicholls said. "My first duty as headteacher is to keep the children safe and we were really wondering how we could keep Stephen and other children safe."

Stephen's parents later allowed the school to make a referral to the CAMHS team. It was also decided he could not return to mainstream school until there was more support, so he was put into 'learning support' at Ripley instead, where he remained until the end of the summer term.

Over the summer Stephen's parents informed Ripley their son would not be returning to the school.

Specialist autism consultant Lynn McCann told the inquest Stephen was "intelligent and funny and had lots of interests he liked to talk about."

Mrs McCann, who had worked with Stephen since he moved to Ripley, said Stephen struggled to express his anxiety and would talk about guns and death as a way of doing that.

He also used song lyrics as a way of expressing how he felt and described himself to Mrs McCann as feeling "on the edge."

"He talked a lot about things he seemed to despair of, such as his future and the point of education," she said. "He said he didn't mean it when he said he was going to kill other people. He didn't understand the effect that it might have on them. Part of autism is not understanding other people's thoughts.

"He was really worried about the world and the state of it and would despair at things like the Iraq War."

Mrs McCann said she became concerned about the frequency and intensity of Stephen's outbursts.

"I was concerned about his underlying mental health," she said. "I do believe Stephen was trying to make sense of it all. He did a lot of thinking out loud and he didn't understand the effect that it could have on others."

Mrs McCann said the school tried to find a way for Stephen to cope following his exclusion.

"Going into a classroom was extremely stressful for him," she said. "Putting him back in class at that time wouldn't have dealt with the problem.

"Trying to get the environment right in a busy mainstream high school is very difficult.

"He struggled a lot to cope with emotions. He felt them very clearly and they influenced his thinking a lot. He wasn't able to self-regulate."

Mrs McCann described Stephen as having the emotional development of a teenager with the understanding of a much younger child.