Mexican President Claudia Sheinbaum on Wednesday ordered Meta, TikTok, X, Apple and Microsoft to remove content inciting violence on their social networks following a spate of deadly attacks in schools.
Sheinbaum gave the platforms a month to comply or face sanctions.
In the past two weeks, two people have been killed and several people injured in two separate school attacks.
The attacks have caused alarm in a country that lives in terror of brutal drug cartels but is a relative stranger to shootings or stabbings in schools.
On October 1, two teenage brothers armed with knives and fireworks killed a female assistant principal and injured three other people at a school in Coahuila state.
Then on Tuesday, a teacher was shot dead at a school in the southern state of Oaxaca, AFP reported.
Sheinbaum linked the violence to "behavior associated with communication on social media."
She said that if the tech companies did not "adjust their algorithms" to remove "all violent content linked to the accounts of children and adolescents," she would legislate to impose sanctions on them.
The decree issued by Sheinbaum on Wednesday orders social networks to prevent minors accessing "images and videos that lead to or encourage violence in a school setting," including "abuse, suicide, self-harm, cyberbullying and hate speech."
The networks must alert the authorities "if they identify content that endangers life."
In a discussion with TikTok and Instagram users, Sheinbaum denied that the new rules amounted to censorship.
"We're not banning social media," she said.