By Joanna Menagh, ABC News
The Perth teenager who sparked fears of an American-style school shooting in Australia has been sentenced to three years in juvenile detention.
In sentencing him, Children's Court of WA president Judge Hylton Quail said it was only "good luck" that had "prevented a tragic outcome".
On a school day in May last year, the 15 year old, who cannot be identified, gained access to his father's gun cabinet and took two rifles and ammunition, before driving to the car park of the Atlantis Beach Baptist College in Perth's northern suburbs where he fired three shots, two of which hit buildings.
The school went into immediate lockdown as terrified staff and students hid in cupboards and under desks to avoid being shot.
Some students and teachers were outside at the time, including one staff member who thought a child, who had ducked behind his school bag to hide, had been shot.
Dramatic arrest
The teenager then rang the emergency line triple-0 and told the operator he had been going to "kill people and myself", but changed his mind because he did not want his siblings to be related to a killer.
Police arrived and arrested the then-slightly built teen in dramatic circumstances, as other officers scoured the school to make sure it was safe.
The boy was initially remanded to the troubled Banksia Hill juvenile detention centre, but 10 days later he was granted bail, first to reside at a supervised hostel, and later to return to the family home to live with his parents.
In December last year, he pleaded guilty to a string of charges including endangering the lives of staff and students at the school, discharging a firearm to cause fear, possessing firearms and ammunition and driving without a licence.
School shootings searched online
The boy, who has grown significantly in height since his arrest, faced a plea hearing last week, which was told how in the 18 days before the incident, he had done internet searches about school shootings, gun deaths, the age of criminal responsibility in WA, and conditions in juvenile detention.
He also used the social media app Discord to talk to a friend about shooting at the school, and the night before he told him not to go to school the next day.
The court heard the friend laughed and did not take what he was told seriously, because he did not believe the boy would do what he was saying.
The boy's lawyer, Simon Freitag SC, urged Judge Quail to consider a non-custodial term for his client, saying at the time he was suffering depression and had undiagnosed autism spectrum disorder.
Freitag said the boy had believed there was no future for him because of a failed short-lived relationship and rumours that were circulating about him.
Bullet landed close to students
Judge Quail said one of the gunshots the teenager fired landed close to where students were walking, including a 12-year-old boy who recounted grass "spitting up" at him from where the bullet landed.
Judge Quail praised the triple-0 operator for the calm and composed way they dealt with the teenager's call.
He said the operator's questions and the boy's answers were the best guide to his intentions that day, including his answer that he had been going "to kill people".
He told the boy while he was satisfied he had driven to the school with that intention, he accepted he had abandoned it by the time he pulled the trigger because he had seen people moving around and had thought of his siblings.
The boy will have to serve 16 months of his three-year sentence before he can be released from detention.
'Extremely serious and wicked'
Judge Quail described the crime, of doing an act that endangered the lives of those at the school, as "extremely serious and wicked".
The court heard details of the fear experienced by the staff and students at the school, including one teacher who said she had never been so scared in her life.
Judge Quail highlighted that the offences occurred at a school in the middle of the day, saying the community expected schools to be sanctities from violence.
He said those factors aggravated the crime.
"This offending has caused fear and anxiety to many vulnerable and innocent people," he said.
Vigilance urged
State Education Minister Tony Buti said the incident highlighted the need to be vigilant about student safety.
"This was a once in a lifetime. It's the first incident in Western Australia, it was at a non-government school," he said.
"It just shows we always have to be vigilant about the welfare of our students and ensure we're always speaking to our teachers and professionals about student wellbeing."
This story was originally published by the ABC.