Inside a large mosque in the Nile Delta, an Egyptian cleric looked over his congregation as he climbed the pulpit clutching a piece of paper and began to speak — delivering a 13-minute discourse on the virtues of personal hygiene.

For the first time in his career, the young imam found himself forced to read a Friday sermon printed from the official website of the Religious Endowments Ministry.

Minutes after he ended the unusually short sermon, uproar spread through the congregation.

Some men in the crowd began shouting "No to written sermons!" while others tried to hush them — a commotion filmed on cellphones and posted online. Similar scenes occurred across the country and in the capital, where one angry worshipper reportedly snatched the paper from the hands of the cleric.

The clamor was in response to a controversial bid by the government to establish control over Egypt's religious discourse. Launched last month, it mandates that all imams at state-run mosques read pre-written sermons distributed by the ministry. The measure — which expands upon a 3-year-old effort to provide general guidelines — is unprecedented in Egypt, even under previous autocratic governments.

Officials say the written sermons are aimed at preventing radicalism. Indeed, extremists' ideas are not uncommon topics in mosque sermons in the Middle East — and in countries such as Saudi Arabia, where the political and religious establishments are intertwined, similar efforts are in place.

"We will be contributing to shaping a new way of thinking," said Mokhtar Gomaa, the minister for religious endowments, when rolling out the first official sermon on July 15.

But in Egypt, home to the Muslim world's oldest and most renowned Islamic institution of learning, Al-Azhar, the move immediately hit a nerve.

Clerics — who are among the thousands of Al-Azhar graduates — perceived the state-dictated sermons as an insult to their status. Some blamed President Abdel-Fattah el-Sissi, a former military chief, for going too far in trying to stifle free speech.

"I found myself between a hammer and an anvil," said the young Nile Delta cleric, who spoke on condition of anonymity for fear of being penalized for criticizing the government.

"I was climbing the pulpit with one eye on this piece of paper, knowing it would instigate anger among the worshippers, and another eye on the ministry's inspector," whose report could lead to penalties or even dismissal.

The measures have exposed a rift between Al-Azhar, which is constitutionally tasked with looking after religious affairs, and the Religious Endowments Ministry, the government's religious arm in controlling mosques and clerics. While the ministry promoted the standardized sermons, Al-Azhar condemned them.

Many clerics said that worshippers — who can easily read the sermons online beforehand — would turn away from the state-hired clerics typically found in large mosques in Egypt's major cities. Some feared the measures would drive people to ultraconservative Salafists and other hard-line clerics who occupy unofficial pulpits in more remote areas beyond government control. How many people already attend such mosques — which are illegal — is not known.

For three years, since the overthrow by the military of an elected government run by the outlawed Muslim Brotherhood, the Religious Endowments Ministry has been giving clerics "outlines" of subjects for their sermons.

But under the new measures, a committee of state-hired scholars is now providing each week's sermon for clerics to read word-for-word. Besides hygiene, topics have included food security and the evils of corruption, and there is a plan to draft 270 such sermons in advance, covering five years. The latest topic, posted online Thursday, was titled "No to terrorism" and warned congregants that tipping off the authorities about any suspected plots was a "national, religious and humanitarian duty."

There have been several high-profile cases of resistance.

The cleric of the mosque of Al-Azhar, Mohammed Abdel-Ati, took the pulpit two weeks ago without a piece of paper, delivering an impromptu speech. Al-Azhar's top scholars issued a strongly-worded statement in which they accused the ministry of "superficializing" clerics' thinking.

Fearing a backlash, President Abdel Fattah el-Sissi stepped in, paving the way for a meeting between Gomaa, the religious endowments minister, and the Sheikh of Al-Azhar, Ahmed el-Tayyab. That ended with a statement by Gomaa saying that unity among religious institutions must be "above all other considerations." But no change was announced.

According to the daily al-Shorouk, the ministry has prepared a blacklist of clerics who don't comply. The Al-Watan daily reported that two imams in the southern city of Minya were suspended for refusing to read the pre-written sermons.

The sermon campaign comes during a wide-ranging crackdown on dissent by el-Sissi's government. All unauthorized demonstrations have been criminalized, thousands have been jailed, activists and rights lawyers have been prosecuted or banned from travel and voices critical of the government have been largely silenced.

Established in 972, Al-Azhar handles the training of religious scholars and issues influential religious edicts. But the Religious Endowments Ministry controls the payment, hiring and firing of imams. And while the sheikh of Al-Azhar is chosen internally by a 50-member committee of senior scholars, the country's president influences who sits on that committee and must approve the final selection.

Al-Azhar backed el-Sissi's ouster of the elected Mohammed Morsi from the presidency in 2013. And it has provided crucial religious cover for el-Sissi's subsequent crackdown on the Brotherhood and purge of alleged Brotherhood loyalists from the country's religious ranks. Some 12,000 freelance preachers have been barred from delivering sermons.

Among Muslims, Friday sermons have a special spiritual status. Millions who normally pray at home during the week attend mass Friday afternoon prayers, and many choose their mosque based on the cleric's eloquence, perspective or rhetorical style.

The ability of an imam to craft and deliver a meaningful sermon is "a sign of excellence," said Mahmoud el-Sawi, a professor of Islamic outreach at Al-Azhar university.

Ahmed, a security guard in his twenties, thought the new state-sponsored sermons were "really dull."

"I look around and I find people either snoring or apathetic," said the young man, who gave only his first name for fear of retribution in a country where government critics risk detention.

For the young Nile Delta cleric, assembling his Friday sermon used to be the main focus of his week — choosing the topic and then doing days of research.

"Now, if I don't abide by the ministry's instructions, I will be at risk of salary cuts or getting fired," he said. "The easiest thing these days is to accuse me of being a member of the Muslim Brotherhood."