French lawmakers have voted to ban the use of mobile phones by pupils in primary and middle schools.
The government said the new law would improve concentration in class, while helping to prevent cyber bullying and the viewing of pornography.
Critics, however, say the ban will be difficult to enforce and opposition parties say it is a publicity stunt.
The bill was the result of a campaign promise made by President Emmanuel Macron last year.
Members of the National Assembly backed the move in a show of hands on Thursday and it now goes to the Senate.
Under the new measures, children up to the age of 15 will have to keep their mobile phones out of sight while on school premises.
Education minister Jean-Michel Blanquer said the measures were "a law for the 21st Century, a law for addressing the digital revolution".
"Being open to technologies of the future doesn't mean we have to accept all their uses," he told MPs.
A late amendment to the bill on Thursday would mean teachers also having to put away their phones during school hours.
If approved, the ban is due to come into force for the new academic year in September.
A 2016 survey showed that nine out of every 10 French students aged 12 to 17 owned a mobile phone.
Common complaints by teachers include pupils texting friends and chatting on social media during lessons.
About half of France's 51,000 primary schools and 7,000 middle schools already ban their use, but ministers say measures need to be put on a stronger legal basis.
Speaking ahead of the parliamentary vote, Philippe Vincent of the school directors' union SNPDEN told AFP news agency that they backed the move "because it reinforces the process".
Critics, however, say the law will prove ineffective and be difficult to enforce.
During the debate, opposition parties dismissed the changes as a publicity stunt. Socialist MP Michèle Victory described it as a "purely cosmetic change".
The new law does not make clear what punishment students face for infringing the new rules and lawyers have said that teachers are not within their rights to take non-dangerous belongings from pupils.