Mobile phones will be banned in primary school classrooms in a New South Wales Government bid to reduce online bullying and risk factors associated with students’ mental health.

The introduction of the new law was announced Thursday and followed a commission in June led by psychologist Dr Michael Carr-Gregg.

Under the new rules, students will be allowed to bring their phones onto school grounds, but will have to hand them over as they arrive and collect them at the end of the day.

Public high schools can choose to implement the mobile phone ban, although it will not be mandatory.

Premier Gladys Berejiklian supported the change, saying teachers had long battled against distractions and bullying in the school environment.

She said mobile phones were distracting for students and could be considered “dangerous” if social media apps were used to target students.

“Mobile phones, unfortunately, are not only distracting but also causing stress for young children – and we can’t have that continue,” Ms Berejiklian told Seven’s Sunrise.

“We want to ensure mobile phones and other smart devices complement students’ learning, and are handled at school in an age-appropriate way,” she told reporters Thursday.

Dr Carr-Gregg said schools had a duty of care to protect its students from the risks mobile phones posed on their mental health.

He called on parents to strip their children of phones with cameras and internet access, instead allowing them devices with basic calling and messaging functions.

The law follows an anti-bullying campaign launched in the wake of the suicide of 12-year-old Dolly Everett in January, who dealt with relentless cyberbullying from students at her school.

If you or someone you know needs help, contact Lifeline on 13 11 14 or Kids Helpline on 1800 551 800, or visit kidshelpline.com.au