At School No. 20 in Russia's troubled region of Chechnya, boys sit on one side of the classroom and girls in headscarves on the other. All are silent as the new teacher rises to speak.
"Do you say your morning prayers?" Islam Dzhabrailov, 21, asks, wearing a green prayer cap and a plain tunic, religious dress that is increasingly popular in the mountainous province in southern Russia's mostly Muslim North Caucasus.
"It's just as important as doing your homework," he tells the students, ages 14 to 15.
One of 420 teachers hired from madrassas to teach the history of religion, Dzhabrailov is driving efforts by Chechen leader Ramzan Kadyrov to combat Islamist insurgency by implementing his own brand of Islam. In this, Kadyrov has the backing of President Vladimir Putin, though some may harbor doubts about the man.
Against a background of stricter guidance on women's dress and wider acceptance of polygamy, critics say Kadyrov is defying Russian separation of religion and state and pushing Chechnya further from Moscow only a decade after federal troops ousted a separatist leadership there to reinstate Kremlin rule.
In nearby Stavropol, part of the Russian Orthodox heartland, a school principal set off a storm when she forbade a small group of Muslim girls from wearing the hijab to class. Putin weighed in, stressing the need for secular standards in schools.
This year, Russian schools started offering courses on the history of world religions, like Orthodox Christianity and Buddhism. A course on secularism is also offered, reflecting attitudes fostered during the era of the communist Soviet Union.
In Chechnya, the lines between the history of religion and religious education are being blurred. Dzhabrailov, who says he is the deputy director of his school's spiritual-moral department, says the program is implemented in Chechnya with materials prepared by local religious leaders.
Although officially the course on Islam is not mandatory, students and teachers say all pupils are obliged to take it. The class focuses on the history of Islam and proper behavior for Muslims. Media reports said that between 99 percent and 100 percent of Chechen students are taking the class.
"A school should provide a secular education. That is what a school is for, and all the more so for Russian schools," said one teacher at the school, who declined to give her name for fear of retribution for speaking out against Kadyrov's policies.
"We have enough madrassas open for those who want a spiritual education," she said.
Critics say the Kremlin has given Kadyrov freedom to enforce Islam as he sees fit and build up his authority in Chechnya in exchange for a crackdown on insurgents seeking to carve an Islamic state out of the North Caucasus.
Kadyrov has targeted insurgents and sometimes their families with strong-arm tactics, including kidnappings and torture, rights groups say. In the neighboring region of Dagestan, insurgents still wage nearly daily violence.
Kadyrov denies the charges as attempts to blacken his name.
Chechnya established a de facto independent government after a devastating war against Moscow from 1994 to 1996, but federal troops reinstated the Kremlin's authority in a second war from 1999 to 2000.
While Kadyrov appears to hold separatists under control in his area, Islamist rebels prosecute an armed campaign in Dagestan to create a Shariah-based Muslim state.
Kadyrov, who invited the likes of Gerard Depardieu to a glitzy birthday bash earlier this month, has strengthened his own authority in the region. His father, Akhmat, was leader of the region until 2004, when he was killed in a bomb attack.
Last year, Chechnya's leadership said it wanted state workers dressed in "Muslim clothes," including the hijab for women. They insist it was a "recommendation," but it is strictly followed. Kadyrov himself has publicly supported polygamy.
Earlier this year, the barrel-chested Kadyrov held a meeting with middle school directors and representatives of spiritual authorities to drive home the point of the new class.
"You must make schoolchildren understand the meaning of true Islam. You must understand that this is a huge responsibility," his government's website reported him as saying.
Where Putin uses his ties with the Russian Orthodox Church to galvanize his conservative base, Kadyrov plays to the religious sentiments of the local population to compete ideologically with an insurgency stoked by human rights abuses, poverty and corruption.
Grigory Shvedov, editor of news portal Caucasian Knot [www.kavkaz-uzel.ru], says Kadyrov is trying to turn Grozny into a new center of the Islamic world.
"He wants to be seen not only as the head of a region but also an Islamic leader, a caliph," Shvedov said. "The problem for the Kremlin is that the more Chechnya develops as the religious center of the Caucasus and Russia, the further it moves away from Moscow."
Kadyrov sought to raise his Islamic credentials earlier this year by bringing what he said were relics of the Prophet Muhammad to Grozny, where they were displayed to men for three days and to women for one. Since then, he has said he will remain the guardian of the relics, which include strands of what he deems to be the prophet's beard.
Kremlin officials do not express worry in public over the increasing role Islam has played, and analysts say Kadyrov will remain loyal to Putin. But the very personal nature of their relationship is also its weakness, said Alexei Mukhin, head of the Moscow-based Center for Political Information.
"Putin depends on Kadyrov and Kadyrov on Putin," he said. "The relationship between Chechnya and Moscow depends directly on that personal relationship, and if either of them were, God forbid, not to be in power, then that relationship could change drastically."
In School No. 20, Dzhabrailov said the region's top Muslim leader has decided who will serve in the schools. But he says his position "was created by ... Ramzan Kadyrov himself."
"The authority is given to us not only to teach but also to look after the moral upbringing of the students of the school," Dzhabrailov said. "We, as spiritual mentors, have the ability to recommend activities of the teachers. All of that, for example, allows me to control the appearance of the female half of the school."
In class, students yell out answers to questions he poses. He tells girls they should not interrupt boys, "even if they are wrong."
Like many buildings in Grozny, School No. 20 is sparkling new. The city was almost entirely rebuilt after the two wars nearly destroyed it. With Kremlin funds, the city is now spotless, and construction projects like business centers and hotels are sprouting, though rarely occupied.
A big new mosque occupies a prominent place. In schools, the dress code for girls is a headscarf. At universities, Kadyrov has outlawed the use of the hijab among female students, but a recent trip to campus showed that many women still wear them, along with long skirts.
New public buildings throughout the region are being built with what locals say are mandatory prayer rooms. In a region where violence and authority have been linked since the fall of the Soviet Union, the classes on Islam appear to be gaining traction.
"I love going to class on the history of Islam, and I want to understand Islam better in a local madrassa," said a student who identified herself as Malika. "I used to not be able to picture myself in a headscarf ... but now I'm already used to it."
Dzhabrailov says the teaching of Islam is necessary among the students to stop the spread of religious fundamentalism, which he said led to the Arab Spring revolts across the Middle East and North Africa.
"We don't teach radical Islam," Dzhabrailov said. "And we don't decrease the freedoms [of our students], as it may appear. It's simply the proper upbringing of a Muslim Chechen society."