MISSISSAUGA, Ontario — The troubles began over sermons.

For nearly two decades, Muslim students in the Peel School District, outside Toronto, had been allowed to pray independently on Fridays, part of a policy in many Canadian provinces to accommodate religious beliefs in public schools.

Last fall, the school board decided to standardize the prayer sessions and offer six preapproved sermons that the children could recite, rather than let them use their own.

Muslim students protested, saying the move violated their right to free speech, and the board reversed itself, allowing the children to write their own sermons.

But the dispute unleashed a storm of protest that continued through this spring.

Demonstrators are picketing school board meetings, arguments are erupting on social media about whether religious accommodation is tantamount to special treatment, and there is a petition drive to abolish prayer in the public schools. In April, a local imam who supported the board received a death threat. The local police now guard the school board’s meetings.