A screen displays the results of the vote on a bill to ban young teens from social media in the French National Assembly in Paris Wednesday. Photo by Teresa Suarez/EPA

July 21 (UPI) -- The French parliament passed a new law to ban children younger than 15 from using social media.

The law was a pet project of President Emmanuel Macron, who is near the end of his term limits. He announced the ban on X immediately after it passed Wednesday.

"I had committed to it, and now it's been voted on: social media will be banned for those under 15 starting back-to-school. Thanks to the parliamentarians. It's up to the Constitutional Council to rule, then on to action to make this measure concrete and protect our children online," Macron said.

The French Senate and National Assembly approved the ban, despite criticism from some on the left, which has said it prevents online anonymity.