Emmanuel Macron has waded into a row over a schoolgirl whose attack on Islam has divided France, insisting that blasphemy is “no crime”.

The French president defended the teenager, named only as Mila, who received death threats and was forced out of her school after filming an anti-religious diatribe on social media.

Macron’s intervention comes after his justice minister, Nicole Belloubet, was criticised for claiming Mila’s attack on religion was “an attack on freedom of conscience” while saying the death threats were “unacceptable”.

The case has sparked a furious public debate in France, a strictly secular republic with a large Muslim population. The education authorities have since found another school for the teenager.

“In this debate we have lost sight of the fact that Mila is an adolescent. We owe her protection at school, in her daily life, in her movements,” Macron said in an interview with Le Dauphiné Libéré newspaper.

The president added that in finding a new school for Mila, “the state has fulfilled its responsibilities” and that children needed to be “better protected” against “new forms of hatred and harassment online that can be destructive”.

“That necessity is separate from the criticism of religion. The law is clear: we have the right to blaspheme, to criticise, to caricature religions. The republican order is not a moral order … what is outlawed is to incite hatred and attack dignity,” Macron added.

Mila, 16, from near Lyon, became a cause célèbre in January after she made a live broadcast on her Instagram account in which she spoke about her homosexuality. She reported that “a Muslim commentator” had responded she was a “dirty lesbian” and a “dirty whore”. She responded by posting a video diatribe against Islam.

Her outburst sparked death threats and social media users posted her personal information online, including where she was attending school. The public prosecutor has opened an investigation for “death threats, threats to commit a crime and harassment” against her attackers and a separate inquiry into whether she had “provoked religious hatred”, which is punishable by the law.

Abdallah Zekri, general delegate of the French Council for the Muslim Faith (CFCM), told French radio: “This girl knows exactly what she has done … they who sow, reap.” Zekri added that the teenager’s comments were not covered by freedom of expression but were insulting and provocative. Afterwards, Mohammed Moussaoui, the new head of the CFCM, said criticism of Islam had to be accepted and no remarks justified death threats. “We have to accept all the debates and refuse all violence,” Moussaoui wrote.

Mila has appeared on French television to say she did not regret the video and to defend the right to blaspheme. She also apologised to those who practise their religion “in peace”.

The far-right leader Marine Le Pen has defended the teenager, saying what she said “may be considered vulgar, but we cannot accept that, in 21st century France, some condemn her to death”.

The case has brought echos of the Charlie Hebdo massacre in 2015, which the perpetrators claimed was in retribution for the satirical newspaper publishing cartoons several years previously of the prophet Mohammed that were considered offensive by many Muslims. In a 2007 legal case against the paper, judges declared: “In France it is possible to insult a religion, its figures and its symbols … however, insulting those who follow a religion is outlawed.”

• This article was amended on 15 February 2020 to clarify that Mila reported that the threats against her came from a Muslim commentator, though this claim has not been independently verified.