ÉVREUX, France — They could have easily shared the same classroom — the immigrant teenager and the veteran teacher known for his commitment to instilling the nation’s ideals, in a relationship that had turned waves of newcomers into French citizens.
But Abdoullakh Anzorov, 18, who grew up in France from age 6 and was the product of its public schools, rejected those principles in a horrific crime that shocked and enraged France. Offended by cartoons of the Prophet Muhammad shown in a class on free speech given by the teacher, Samuel Paty, 47, the teenager beheaded him a week ago with a long knife before being gunned down by the police.
France has paid national homage to Mr. Paty because the killing was seen as an attack on the very foundation — the teacher, the public school — of French citizenship. In the anger sweeping the nation, French leaders have promised to redouble their defense of a public educational system that plays an essential role in shaping national identity.
The killing has underscored the increasing challenges to that system as France grows more racially and ethnically diverse. Two or three generations of newcomers have now struggled to integrate into French society, the political establishment agrees.
But the nation, broadly, has balked at the suggestion from critics, many in the Muslim community, that France’s model of integration, including its schools, needs an update or an overhaul.
President Emmanuel Macron’s emphatic defense of the caricatures has also led to ripples overseas. Several Muslim nations, including Kuwait and Qatar, have begun boycotting French goods in protest. President Recep Tayyip Erdogan of Turkey questioned Mr. Macron’s mental health in a speech, prompting France to recall its ambassador to Turkey.
Mr. Anzorov was the latest product of France’s public schools to turn against their ideals: Two brothers who went to public schools in 2015 attacked Charlie Hebdo, the satirical magazine that published — and republished last month — caricatures of the Prophet Muhammad.
Jean-Pierre Obin, a former senior national education official, said that public schools played a leading role in “the cultural assimilation and political integration” of immigrant children who “were turned into good little French” and no longer felt “Italian, Spanish, Portuguese or Polish.” Other institutions that also played this role — the Catholic church, unions and political parties — have been weakened, leaving only the schools, he said.
“Today, public schools can’t fully do this,” Mr. Obin said. “But I don’t see another model — especially the Anglo-Saxon model of multiculturalism, which I don’t think is more successful.”
The French model ran into obstacles when the immigrants were no longer European, white or Roman Catholic. Today about 10 percent of France’s population is believed to be Muslim.
The push to assimilate risks engendering a form of xenophobia in the broader population, said Hakim El Karoui, a senior fellow at the Paris-based think tank Institut Montaigne.
“The message is: ‘We don’t want your otherness because we want you to be like us,’” he said.
The children who fail to assimilate — and often end up lost, feeling that they belong to neither France nor their ancestral countries — embody the doubt “that our model is not the right one,” Mr. El Karoui said, a possibility that the French “obviously find unbearable.”
It was in schools that immigrant children learned not only proper French, but also how to politely address teachers as “Madame” or “Monsieur.” They also absorbed notions like secularism in a country where, much like in the United States, ideals form the basis of nationhood.
At least on paper, Mr. Anzorov seemed a good candidate to fit into French society. A Russian of Chechen descent, he arrived in Paris when he was 6 and entered a public primary school. When he was about 10, his family moved to Évreux, a city in an economically depressed area about 55 miles west of Paris and home to about 50 Chechen families, according to Chechens living in the city.
The Chechens largely kept to themselves in Madeleine, a poor neighborhood with other immigrants, who are mostly from former French colonies and whose integration is often complicated by France’s colonial legacy.
Mr. Anzorov attended a middle school called Collège Pablo Neruda that, hewing to the national curriculum, also offered civics lessons on secularism and freedom of expression. He lived in a rent-subsidized, five-story apartment building with his family, with a direct view of the local jail.
“He always passed in front of my place when going home,” said Ruslan Ibragimov, 49, a Chechen who arrived in Évreux 18 years ago. “He was always alone, with his backpack. Even when he would see me from afar, he’d come over to greet me. He never talked much.”
Never much interested in his studies, Mr. Anzorov was passionate about mixed-martial arts, said a 26-year-old Chechen who also practices the sport. When he was 16 in 2018, Mr. Anzorov lived for a while in Toulouse, where he had an uncle.
There, he joined a sports club that had a Chechen coach and a good reputation among athletes, the 26-year-old said, speaking on the condition of anonymity because he said he feared reprisals against Chechens.
“His goal was to fight in the U.F.C.,” the 26-year-old said, referring to the Ultimate Fighting Championship, a top promoter of mixed martial arts.
Located in a public facility, the club was investigated by the local authorities because some members prayed in the locker room and asked women to cover their arms and legs, according to the French news media.
In a country guided by strict secularism, such actions are a violation of French law and regarded as signs of radicalization by the authorities — and they have led to many sports clubs being placed under surveillance.
But it was not known what, if any, influence the club exerted on Mr. Anzorov, who had not been on any terrorism watch list.
Unsuccessful in Toulouse, Mr. Anzorov came back to Évreux. His father, who specialized in setting up security for construction sites and other businesses, was encouraging his son to join him, Mr. Ibragimov said. The father had recently bought his son a car, he added.
“But he couldn’t drive it yet because he still hadn’t gotten his driver’s license,” Mr. Ibragimov said.
It was only in recent months that the teenager had shown signs of radicalization, said the special antiterrorism prosecutor, Jean-François Ricard. Mr. Anzorov’s transformation appeared to have played out online, according to an analysis by the French news website Mediapart of a Twitter account that he created in June and that was deleted last week after his death.
His posts on Twitter attacked a wide range of targets — from Jews to Christians to the rulers of Saudi Arabia.
Mr. Paty was teaching history and civics at a middle school in Conflans-Sainte-Honorine, a middle-class Paris suburb, at the time of the attack.
“He is the kind of teacher who leaves his mark, by his gentleness and open-mindedness,” said Maeva Latil, 21, who joined a tribute in front of the Jacques-Prévert middle school, in a small village south of Paris, where Mr. Paty taught between 2011 and 2018.
In history classes, he used contemporary examples — from Pink Floyd songs to a book on racism by a soccer player — to make his teaching resonate with his students, said Aurélie Davoust, 43, a former literature teacher at Jacques-Prévert.
“With him, there was really this aspect: You don’t study history to talk about dead things, you study history to become a citizen,” she said.
Mr. Paty was a strong believer in laïcité, the strict secularism that separates religion from the state in France. Ms. Davoust recalled Mr. Paty once asking a young girl wearing a cross around her neck in school to take it off.
“Our democracy was established against the Catholic Church and the monarchy, and laïcité is the way that democracy was organized in France,” said Dominique Schnapper, a sociologist and president of the Council of the Wise, a group created by the government in 2018 to reinforce laïcité in public schools.
In a class on freedom of expression — including the right to say blasphemous things about all religions — Mr. Paty used caricatures of the Prophet Muhammad, Jesus and rabbis to teach, former students said.
After his transfer a few years ago to Conflans-Sainte-Honorine, in a Paris suburb with a more diverse population, he appeared to adjust his approach. When showing caricatures, he began telling students who might be offended that they could leave the classroom or look away.
At the new school, students said he showed mostly caricatures of the Prophet Muhammad that had been published by Charlie Hebdo. One of the two shown this month was titled “A star is born” and depicted Muhammad fully nude. That upset many Muslim students and their parents, according to the local chapter of PEEP, a national parents association.
Mr. Paty said he was surprised by the backlash and apologized to students, said Talia, a 13-year-old student who was present at the lecture.
“He told us that he’s a teacher, that this class is part of his program, that France is a secular country and so is our school,” said Talia, who asked that she be identified by her first name only given the sensitivity of the situation.
One angry father complained about the teacher in videos he uploaded on social media. Enraged, Mr. Anzorov, the Chechen teenager, traveled all the way from Évreux to Conflans-Sainte-Honorine, nearly 60 miles, to kill Mr. Paty.
“Did he never have committed teachers? Or did he have them and he didn’t hear them?” Ms. Schnapper, the president of the Council of the Wise, said of Mr. Anzorov’s years in France’s public schools. “We’ll never know. But it’s a sign of failure.”
Antonella Francini contributed reporting.