The victim had recently shown caricatures of Muhammad in his class on freedom of expression, causing anger within the community.
According to French media, a history teacher was decapitated on a street in Conflans Sainte-Honorine, northwest of the French capital, at about 5pm local time.
"French Police Fatally Shoot Man Who Beheaded Teacher on the Street", is the headline that America's esteemed "paper of record" chose to go with for its article conveying this incident. Those held were related to the assailant, who was shot dead by police following the murder.
One rally was set to take place at the Place de la Republique in Paris, a traditional site of protest where around 1.5 million people demonstrated in 2015 following a deadly attack on Charle Hebdo's office by Islamist gunmen.
The pupil, speaking beside her mother, said no one had made a fuss about the class previous year.
Earlier in October, President Emmanuel Macron gave controversial remarks vowing to fight what he called "Islamic separatism" and to send a bill to parliament early next year imposing further restrictions on Muslim people in the country.
The allegations are similar to charges brought last month against a 25-year-old man who wounded two people in a meat cleaver attack to avenge the publication of blasphemous sketches by the satirical weekly Charlie Hebdo. One posted a video online, releasing Paty's name, calling for his dismissal and filing a complaint against Paty at the police station for "disseminating pornographic images".
The friend, a known militant, was already on the radar of French intelligence services. Five more were detained overnight, including the father of a pupil at Paty's school, College du Bois d'Aulne, and an acquaintance of the pupil's father known to the intelligence services, the anti-terrorism prosecutor said.
"It is at the same time a teacher who was assassinated but it is also the freedom of thought, of expression, which were infringed", Ricard said at a news conference in which he said an anti-terror probe was opened with charges of "assassination in connection with a terrorist enterprise" and "criminal terrorist association".
Police added they were investigating a tweet from a deactivated account that allegedly showed a picture of the victim's body.
Some carried placards stating: "I am a teacher" and "I am Samuel" - echoing the "I am Charlie" cry that traveled around the world after the 2015 Charlie Hebdo killings.
A national tribute will be organised for Wednesday, Macron's office said.
Parents of students laid flowers at the school gate.
"A teacher was assassinated for the work that he does, but freedom of thought, freedom of expression, and the ability to teach these fundamental principles in our schools have also been attacked", added Ricard.
"He didn't do this to create arguments or to disrespect", says Nordine Chaouadi, whose 13-year-old son enjoyed Paty's classes.
According to parents and teachers, Paty gave Muslim children the option to leave the classroom before he showed the cartoons, saying he did not want their feelings hurt.
Virginie, 15, said Paty showed the cartoons every year as part of a discussion about freedom following the Charlie Hebdo attack.