A 15-year-old boy accused of firing three shots at a Perth school told a triple-0 operator he had been "going to kill people" and himself after allegedly firing shots at Atlantis Beach Baptist College, a court has head.
The teenager faced Perth Children's Court on Wednesday, and was granted bail, but he will have to reside at a special youth hostel where he will be under strict supervision.
In opposing bail, prosecutors revealed further details of his alleged crimes, including that he said he stopped shooting because he did not want his brother and sister to be the siblings of a killer.
State prosecutor Brad Hollingsworth said the two rifles and ammunition the boy had allegedly used were licensed to his father.
The court was told there was "absolutely" no suggestion the boy's father had failed to properly store his firearms, with Mr Hollingsworth saying he told detectives his son, who knew how to use the guns, had found the keys to the secure cabinet.
Mr Hollingsworth said the parents were "no doubt mortified" by what is alleged to have happened and they were being "entirely open and co-operative with police".
The court heard the boy then drove his father's car to the college in Two Rocks in Perth's north, and from about 60 metres away, fired one of the rifles three times.
Mr Hollingsworth said two of the gun shots hit buildings, including one which hit a demountable classroom with a teacher and student inside.
Teen warned he would 'shoot up the school'
The court was told in the weeks before the alleged shooting, the boy had missed a lot of school and he told triple-0 the day before that his mother had "unenrolled" him from the college.
In the lead up, he allegedly conducted internet searches about "firearm shootings" and "education in detention centres" as well as speaking to a friend about school shootings in America.
He is also alleged to have told another friend he was "going to shoot up the school" but they did not believe him.
Mr Hollingsworth said there appeared to be no significant reason for the boy's alleged actions, although he told the court the teenager had not been able to get work experience and he may have also been "bothered" by an issue with a female, which was not detailed in court.
Mr Hollingsworth highlighted the triple-0 call the boy made, describing his demeanour as "calm, cool and collected" and raised concerns that if he was released from custody, he would pose a risk to others and himself.
Magistrate highlights Banksia Hill concerns
However, Magistrate Alana Padmanabaham said she was satisfied that the boy's significant mental health issues could be treated in the community.
She highlighted conditions at the troubled Banksia Hill juvenile detention centre, where the boy has been held, saying if he remained in custody there, the continued lockdowns and lack of access to educational programs were likely to have an impact on his mental health.
Earlier a psychiatrist, who assessed the boy, told the court in her opinion, he did not need to be admitted to a psychiatric facility.
She said while he does have mental health needs, they can be adequately addressed in the community or in custody.
The boy's parents were in court for the hearing, but the magistrate was not prepared to grant bail that would allow him to live with them at their home, saying she had concerns about their ability to supervise their son and their understanding of his mental health.
The boy is due back in court in July.
His bail conditions include that he is not allowed to access the internet without supervision and that he does not go within 100 metres of the Atlantis Beach Baptist College.