A vulnerable teenager who fired gunshots at a classroom, sparking fears of Australia's first US-style school shooting, told police he planned to kill people and himself.
The 15-year-old boy, who cannot be named for legal reasons, took two rifles to his school, the Atlantis Beach Baptist College in Two Rocks, about 70km north of Perth, on May 24 last year.
He fired three shots from his father's .243 hunting rifle sending students and teachers scrambling for cover as two bullets hit a classroom and another a grassed area near a playground.
Prosecutor Tiffany McArthur told Perth Children's Court on Friday that it 'was good fortune no one was killed" by the boy, who called triple zero immediately after the incident and admitted to the shooting.
During the call, he told the operator he was angry and that he had no future because he "flunked year 10" and that he wanted to injure "anyone".
"I'm not sure if there's anyone been shot. I shot at people," he said.
"I was going to kill people and myself."
But he didn't carry out his plan, telling police "he didn't want his siblings to be the siblings of a killer".
He was arrested at the scene and later pleaded guilty to eight charges, including two counts of unlawfully acting with intent to harm and endangering the lives of students and teachers.
He also admitted three counts of possessing a firearm or ammunition without a licence, discharging a firearm to cause danger or fear, possessing a prohibited weapon and driving without a licence.
The incident plunged the school into lockdown amid reports a gunman dressed in black was aiming his weapon at students in the playground.
One student lay on the ground and attempted to use a backpack as cover, causing a teacher to fear he had been shot.
Others ran into classrooms and hid under tables and in cupboards and storerooms.
"They were clearly terrified and ran for safety," Ms McArthur said during sentencing submissions.
One teacher said: "I felt at any time any of us could be shot and killed. I have never felt so scared in my life".
"I texted my fiance and told him what happened and I loved him."
In the months before the shooting, the boy, who has been diagnosed with autism spectrum disorder and was suffering a depressive episode at the time of the incident after being bullied and targeted by gossip, started planning.
The court heard he made dozens of internet searches for information about school shootings, massacres and the age of criminal responsibility.
Four days before he pulled the trigger, the teen "talked a lot about mass shootings in the US" during a discussion with a friend.
He told another the night before the incident to stay home the following day because he was going to shoot the college. Neither took him seriously.
They should have. The next morning the boy unlocked his dad's gun safe and removed two rifles before driving his father's four-wheel-drive to the school.
Court President Hylton Quail said it was a unique incident and there was no legal record of a school shooting in Australia prior.
He ordered for the boy to be taken into custody, telling him that although he had not decided on a sentence it would involve detention and that would begin immediately.
"There is a lot I have to think about and you know how serious this is," he said.
Atlantis Beach Baptist College is a co-educational school for boys and girls from kindergarten to year 10.
The teen is scheduled to return to the same court on Thursday for sentencing.