The legislation, which has taken three years to pass through parliament, follows several high-profile suicides of cyberbullying victims.

The law provides a legal definition of cyberbullying, and requires all schools to educate pupils on how to use the internet responsibly and to have a member of staff assigned to tackling cyberbullying. It will become illegal to offend, slander, threaten or steal the identity of a minor online.

Victims or their parents will be able to demand that websites hosting hurtful content have it removed. If the content is not deleted after 48 hours, victims can appeal to an independent privacy guarantor which will intervene with the site’s management.

Cyberbullying guidelines will be updated every two years by the education ministry to keep up to date with the rapidly evolving social media landscape.

The legislation was passed unanimously by the Chamber of Deputies, with 432 votes in favour and one abstention. Laura Boldrini, speaker of the Chamber, said that the law was dedicated to Carolina Picchio and all the other victims of cyberbullying.

Carolina Picchio was 14 when she threw herself out of a window, following the circulation of an explicit video filmed at a party. A flood of abusive messages from her ex-boyfriend and his peers were reported to Facebook but according to Picchio’s family, no action was taken.

Meanwhile, at the end of last week, the Texas House approved a bill 130 to 11 to crack down on cyberbullying in schools. The bill is named David’s Law, after student David Molak, who committed suicide at 16 following bullying.

The bill would require public schools to draft cyberbullying policies, and establish methods for students to report cyberbullying anonymous. The bill also makes it a criminal offence to bully a child with intent to provoke self-harm or suicide.

Representative Joe Moody, Democrat representative for El Paso (D-El Paso), commented that: “Young people aren’t just hurting each other on the playground these days. This bill isn’t designed to stifle free speech or criminalise something harmless.”