The initiative was proposed by the La République en Marche (LREM) party, with a view to “sending a signal to society”.
It received majority support from the LREM, Democratic Movement (MoDem) and UDI-Agir parties, but caused concern among others, especially the Socialists and Les Républicains.
The law would forbid the use of all connected devices in schools, except for “educational purposes” or when helpful to handicapped or disabled pupils.
There are 8.5 million pupils in public schools and collèges across the country, of which figures suggest 86% of those aged 12 to 17 own a smartphone or connected device.
Jean-Michel Blanquer, national education minister, called the proposal a “law for the 21st century”, which would “send a signal to society on this social issue”.
He said: “Being open to future technology does not mean we have to accept it at all times or uses”, and listed “bad uses” for technology to illustrate his point - including cyber-harassment, pornographic content, and Internet addiction.
Since 2010, the education code has forbidden the use of mobile phones in schools “during all teaching activity and in areas not allowed by establishment rules”, but this proposal would enshrine the rule in law.
Mr Blanquer said: “[This law would offer] a much more solid legal base.”
Bruno Studer (LREM), former history and geography teacher and current president of the culture and education commission, said: “We are moving from a principle of authorisation except where prohibited, to a principle of prohibition.”
Headteachers and senior staff will have the freedom to decide how to enact the measure, MPs said.
Currently, only half of public schools and collèges are said to have an official “no phone” policy.
Yet, the proposal has received criticism from some MPs.
Frédéric Reiss, former maths teacher and Les Républicains (LR) MP from the Bas-Rhin region, said the law was not needed, and that the problem could be solved by “simple communication” in schools.
His colleague, Patrick Hetzel, also an LR MP and former university professor and higher education director, called the proposals “a mockery”.
Michèle Victory, socialist MP for the Ardèche, said the measure would offer a “purely cosmetic change”, and said spending time on the proposals had been a “useless” waste of time, especially when the “parliamentary agenda is already full enough”.
However, the education minister defended the proposals, saying that there was a “huge” difference between the existing rules, and the proposed changes.
Using a metaphor to explain, he said: “Some people are trying to tell us that this law is useless.
“But if you go onto a beach, where you are not allowed to swim in the sea unless it is explicitly allowed, versus a beach where you are always allowed to swim except when explicitly forbidden...You will see that you will not swim the same amount on both.”
Sign up to our free weekly e-newsletter
Subscribe to access all our online articles and receive our printed monthly newspaper The Connexion at your home. News analysis, features and practical help for English-speakers in France