FEW Egyptians dare challenge Abdel-Fattah al-Sisi, their authoritarian president. But one institution has stood up to him. “You wear me out,” Mr Sisi reportedly told Ahmed al-Tayeb, the grand imam of Cairo’s al-Azhar University, last month.

It has been over two years since Mr Sisi, an observant Muslim, lamented that some of his co-religionists were becoming “a source of worry, fear, danger, murder and destruction to all the world”. He urged Egyptian clerics to push back against the jihadists of Islamic State (IS). Egypt itself was a victim, he said: angry Islamists have attacked the government and an affiliate of IS battles the army in Sinai. To combat such extremism, “a religious revolution” was needed, said Mr Sisi—and al-Azhar, the Sunni world’s oldest seat of learning, should take the lead.

But the clerics, led by Mr Tayeb, have largely resisted Mr Sisi’s appeal. Though al-Azhar bills itself as moderate, critics say that it has allowed hardliners to remain in senior positions and failed to reform its curriculums, which include centuries-old texts often cited by extremists. It has blocked efforts at social reform and tried to censor its critics. “Nothing has been done since the president called for renewing religious discourse,” said Helmi al-Namnam, the culture minister, last August.

For most of its 1,000-year history, al-Azhar has acted independently. Each year it trains thousands of preachers, while tens of thousands of students, foreign and local, study in its schools. But it has also delved into politics, often frustrating Egypt’s rulers. Gamel Abdel Nasser, Egypt’s president from 1956 to 1970, reined in the clerics by nationalising their endowments. He and his successors pushed al-Azhar to issue fatwas (religious edicts) justifying their policies. This hurt the institution’s credibility, but further enshrined it as the main arbiter of the faith in Egypt.

Mr Sisi has also used al-Azhar. When he ousted the Muslim Brotherhood from government in 2013, Mr Tayeb sat by his side. The new constitution, adopted in 2014, gave al-Azhar more autonomy. But since then Mr Sisi has tried to exert control over religious matters. He has closed mosques and banned preachers who are not registered. In 2015 the authorities began to standardise Friday sermons, a move designed to undercut radicalism—and to promote the president’s policies. (His expansion of the Suez Canal, for example, was called a “gift from God”.)

Al-Azhar has pushed back. It says its preachers can deliver their own sermons. Some clerics have publicly opposed his tough stance against female genital mutilation, though officially al-Azhar agrees with him on this. After the president called for an end to verbal divorce—a man must simply say “talaq” (divorce) three times—a council of scholars from al-Azhar deemed the practice perfectly Islamic. “Society needs to adapt to the rules of Islam, not the other way round,” said one professor.

Mr Tayeb insists that al-Azhar is “the pulpit of moderate, centrist and tolerant Islam”, but it is not monolithic. “People within al-Azhar are just as divided as the Egyptian society,” says Amr Ezzat of the Egyptian Initiative for Personal Rights, a pressure group. Some of its students and preachers are Salafists (purists); many are sympathetic to the Brotherhood. The government has little control over its personnel and Mr Tayeb tolerates the different factions. “He is not strict against religious extremism,” says Mr Ezzat.

Despite the differences within its own walls, al-Azhar has tried to shut down debate outside. It has filed lawsuits against several authors and artists under Egypt’s blasphemy laws. A recent victim is Islam Behery, who parsed sayings of the Prophet Muhammad and criticised al-Azhar on his television show, “With Islam”. The institution brought several suits against him, resulting in a one-year prison sentence (he was later pardoned by Mr Sisi). “The blasphemy law is used by al-Azhar as a sword,” says Ahmed Khatib, who has reported on corruption at the institution—and who is also being sued by the clerics.

Were al-Azhar to embrace reform, some still doubt it would win over the Muslim masses. Its communication skills cannot match IS or the Brotherhood, which beam their message out on satellite television and social media. Al-Azhar has been trying to set up a TV station for years, to no avail.

Religious reform is anyway only a partial solution. Many analysts blame authoritarian rulers like Mr Sisi for causing the resentment, alienation and frustration that seem to fuel violent extremists. “You are asking al-Azhar to renew religious discourse while the state is not renewing its own discourse,” says Kamal Habib, a political analyst and former jihadist himself. “There is no mechanical relationship whereby you change religious discourse and therefore things will be better.”

Correction: An earlier version of this article incorrectly referred to the journalist Ahmed Khatib as Ahmed al-Habib. This was corrected on February 20th