With its watchwords of dialogue and coexistence, the Mohammed VI Institute that trains Muslim prayer leaders to serve in Morocco and abroad was Saturday one of the first stops on Pope Francis's visit to the kingdom.
Since 2015, the institute has received trainee imams from Morocco as well as several other African states and France.
Under the patronage of King Mohammed, its mission is to counter "radical speech", its director Abdeslam Lazaar said.
The lure of the Islamic State group before the final defeat of its cross-border "caliphate" in Syria earlier this month has underlined the extremists' reach.
From Morocco alone, 1,600 young people are estimated to have signed up to fight for the jihadists in 2015.
The institute admits 1,300 students, men and women, for two- or three-year courses. The men graduate as imams, the women as preachers.
Ahmed Tijane Kebir, 30, from Senegal, who started his studies in February last year, plans to return home on graduation and "show the true face of Islam" in leading prayers.
The director outlines the task facing teachers at the institute.
"At the start of the course, some students come up with mistaken ideas because of a poor understanding of Islam," Lazaar said.
"The teachers start by correcting the mistaken concepts and making the case that these are the misinterpretations of takfiris," he said, referring to followers of a Sunni extremist brand of Islam.
One teacher said it is often new arrivals from France whose thinking is the "most radical" and that "there's really a lot of work to do with them".
The curriculum covers the Koran and the Hadith, a record of the words and actions attributed to the Prophet Mohammed.
'Global view of other religions'
"We also have an introductory course on Christianity, Judaism and comparative religion," the director said. "These give them a global view of other religions to be able to coexist with other communities."
The institute, built in an Andalusian-inspired architecture, boasts several amphitheatres, a sports hall, prayers room, studios for religious recordings and a library.
The women mostly wear long jalabiya robes and headscarves, the men traditional costumes or tracksuits. Studies are mixed, but not prayers, sports or meals.
Morocco covers the costs of food and accommodation with a monthly bursary of 2,000 dirhams ($200).
Since it was hit by a wave of attacks in its economic capital Casablanca in 2003 that cost 33 lives, Morocco has sought to channel religion onto a more "tolerant" path.
Imam training programmes in Morocco date back to 2004, and the official degrees have become compulsory for new preachers.
On the diplomatic front, "the institute is a pillar of Morocco's religious politics in Africa," alongside its distribution of Korans and construction of mosques, author and academic Salim Hmimnat told AFP.
"It's also a way of making the foreign imams serve as ambassadors of the Moroccan religious model."