CAIRO (AP) — It was a startling collision of religion and politics. Egypt's president proposed a new law that would prevent Muslim men from ending their marriages simply by saying "divorce" three times. The country's top institution of Islamic clerics, Al-Azhar, bluntly rejected the idea, saying Islam gives men that right and nothing can change that.

In the months since, that confrontation escalated into a blistering feud over who speaks for Islam and how to bring reforms. Pro-government media accuse Al-Azhar of failing to modernize its teaching to counter militant thought that breeds jihadi movements and violence like the Islamic State group's recent attacks on Egypt's Christians.

This weekend, Pope Francis meets in Cairo with Al-Azhar's grand imam, Sheikh Ahmed el-Tayeb, their second meeting in a historic initiative to improve Muslim-Christian dialogue.

Al-Azhar is revered in Egypt and is prestigious across the Muslim world. A 1,000-year-old university of scholar-clerics, it teaches new generations of Sunni clerics and produces research that for many spells out what being a Muslim entails.

Although it is traditionally touted as the bastion of moderate Islamic thought, it is also conservative in instinct — wary of new ideas and debate, and fixated on maintaining authority.

It vehemently condemns militant attacks and denounces extremist thinkers as perverting Islam. But critics say it is plagued by the same sort of literalism and adherence to historic texts of interpretation that radicals thrive on and that feed intolerance and discrimination against women and minorities, including Christians.

In recent years, it has pushed for the closing of a TV show of a broadcaster who said canonical books of interpretation should be purged of ideas promoting violence and hatred for non-Muslims. In another case, Al-Azhar suspended one of its professors on allegations of "promoting atheism" after he taught from books by liberal writers.

"Our nation will never be a modern and civil state as long as Al-Azhar continues to live on its present rationale," said Mohammed Abu Hamad, a pro-government lawmaker who has recently authored a draft bill that give authorities more controls and limit the number of years its grand imam can serve.

Al-Azhar issued an angry statement last week, calling the criticism "a betrayal" and maintaining its graduates are "messengers of peace, security and good neighborliness."

The government campaign raises another worry — that President Abdel-Fattah el-Sissi is trying to impose greater control on Al-Azhar. The more Al-Azhar is seen as a branch of the Egyptian state, the less legitimacy its voice on Islam has, supporters argue. Radical jihadi sheikhs already dismiss Al-Azhar as "clerics of the sultan" willing to skew "true Islam" to meet the ruler's wishes.

Soon after taking office in 2014, el-Sissi called for the "modernizing of religious discourse," saying Muslims had to dramatically rethink how to address issues to stem Islamic militancy. He has never given specifics, but tasked Al-Azhar with leading the initiative.

Last year, he showed his displeasure with the lack of change, warning that Al-Azhar's clerics would be "held accountable by God" for not modernizing discourse. He ordered his Religious Affairs Ministry to write standardized sermons for all mosque preachers, despite Al-Azhar objections.

The unusual clash over divorce came earlier this year. Criticism accelerated, particularly after IS suicide bombers attacked two churches on April 9, killing 45 people. Some in pro-government media blamed Al-Azhar, saying it had not tackled extremism or had even fueled it.

"Al-Azhar has failed to counter terror," declared Ahmed Moussa, the most vocal of el-Sissi's supporters on television.

After the attacks, el-Sissi ordered the creation of a new state body tasked with fighting terror and addressing radicalism, seen as circumventing Al-Azhar.

Al-Azhar has pushed back with unusual vehemence. For weeks, its mouthpiece, the weekly newspaper Voice of Al-Azhar, has expressed outrage over the criticism, even blaming government failures for terror attacks.

El-Tayeb defended Al-Azhar's role, saying its clerics "stand firm against mistaken ideas that distort religion."

At its heart, Al-Azhar is an education network of hundreds of "ulema," or religious scholar-clerics, who study the Quran and the thousands of sayings of the prophet as well as the vast library of interpretations of those texts written by scholars over the centuries. From that analysis, they produce explanations, dissertations and opinions on proper belief and practice. Its college produces clerics who work in mosques around the world.

Those books of interpretation — some of them hundreds of years old and collectively known as "al-turath" or "heritage" — have become nearly unquestioned canon and are used in the Al-Azhar curriculum.

But some include deeply hard-line ideas. For example, media have pointed to books that teach that Muslims must not greet Christians on their holidays or that building churches is a sin. Others say fighting "infidels" is a duty or that those who convert from Islam to another religion should be killed, or call for oppression of homosexuals.

Ayman al-Sayyad, a writer on religious issues, said jihadi thought "is not coming from nothing," and extremists can find backing in the volumes of interpretation. "In Al-Azhar's library, you can find two books next to each other on the shelf giving opposing views on one topic, like punishment of an apostate."

Al-Azhar's leadership says the conclusions that radical clerics and terror groups reach are complete misreading — such as the permissibility of declaring other Muslims infidels, of killing civilians and of using suicide bombings as well as the duty to wage jihad against Western nations and their Mideast allies. Shariah punishments like stoning adulterers and amputations for thieves, Al-Azhar says, are not applicable in the current age.

Still, texts with those ideas get taught, sometimes uncritically, in Al-Azhar's colleges because they are seen as part of the canon alongside moderate interpretations. They are also taught at the network of elementary, middle and high schools Al-Azhar runs across Egypt, which teach religion alongside math and sciences and other topics.

Critics in pro-government media say such texts should be thrown out. But Al-Azhar has resisted what it sees as "unqualified outsiders" weighing in.

Islam Behery, a young reformist religious researcher, ran into trouble when he said on his TV program that books of heritage should be purged of ideas that fuel terrorism.

A criminal court sentenced him to a year in prison on charges of "contempt of religion," a rare punishment. He was released late last year by a presidential pardon after serving most of his sentence. Al-Azhar, though it denies being behind the complaint that led to his trial, has pushed for Behery to be taken off the air, accusing him of undermining the fundamentals of Islam.

Al-Azhar's personnel aren't fit to bring about change, "and it isn't letting others do it, either," he said in an interview with the AP.

"When I keep on saying, 'These books are wrong and don't represent Islam,' and Al-Azhar imprisons me, it is reinforcing (extremists') ideas," he said.

Mahmoud Mehana, a senior Al-Azhar official, said committees have reviewed all the institution's books and curricula. "They contain nothing that is insulting (to others) or calls for terrorism or violence," he told the AP.

"The heritage is correct, but those who implement it are wrong," he said.

Al-Sayyad, the writer, argues that Al-Azhar needs to include all the texts. But rather than just declaring hard-line interpretations wrong, discussion must be made freer to let more progressive ideas emerge and address them.

"There will be no liberalization of the religious discourse, or anything else for that matter, unless a climate of freedom prevails in society."

___

Associated Press Writer Sam Magdy in Cairo contributed to this report.