A Muslim prays during Maghrib (evening) prayer on the night of the Hijri New Year, also known as Islamic new year (Ras al-Sanah al-Hijriya), at Al Azhar mosque in old Cairo on Nov. 14, 2012. (AMR ABDALLAH DALSH/REUTERS)

The revolution that began here two years ago with calls for justice and freedom has become a rout by Islamist forces that have racked up victory upon victory at the polls.

But within Egypt and across the region, the real source of fears that the country is careening toward theocracy lies in an unlikely place: the ancient stone corridors of al-Azhar, a Cairo institution that has long been known as a respected beacon of moderation.

That reputation is under threat, as far more hardline elements of Egypt’s Islamic mosaic stage a rear-guard action for control. It is a battle that will gain newfound urgency on Saturday, when voters are expected to approve a draft constitution that gives al-Azhar extraordinary power to pass judgment on the religious merits of the nation’s laws.

Al-Azhar leaders say they didn’t want the role but were pressured to accept it by adherents to a puritanical, Saudi-influenced school of Islam known as Salafism, whose clout has surged in Egypt’s newly democratic era.

“The Salafis want to make Azhar a part of the political system, which we are against,” said Abdel Dayem-Nossair, an adviser to al-Azhar’s grand sheikh and a member of the assembly that wrote the new constitution. “We don’t like to put the law in terms of a religious dogma that says ‘this is right’ or ‘this is wrong.’ ”

But under the new constitution, that is exactly what the millennium-old mosque and university complex will soon be doing. Dayem-Nossair said he believes the Salafis insisted on the provision because “they think they’ll take over al-Azhar.”

The fight over al-Azhar’s nature and role is one with profound implications for Egypt, but also far beyond. As much as anything, the Arab Spring uprisings and the tumult that followed have turned on the question of where Islam fits in society and who gets to interpret Islam.

Al-Azhar has played a venerated role in that debate for centuries. It is widely considered the most distinguished center of Sunni Islamic thought, and it annually educates millions of students, many of whom travel here from across the globe.

At a time when more austere and intolerant forms of Islam are ascendant, al-Azhar has offered an antidote, preaching pluralism, respect for non-Islamic cultures and rights for women and minorities.

Many secular and Christian Egyptians worry that a turn toward hardline ideology by al-Azhar could lead to a more rigid interpretation of Islamic law, known as sharia, which under both the old and new constitutions forms the basis of Egyptian legislation. That in turn could mean fewer freedoms for Egyptian artists and academics, restricted rights for women in their homes and at work, and increased blasphemy prosecutions for perceived insults against Islam.

The struggle over the direction of al-Azhar is being nervously watched by moderate Arab leaders across the Middle East. Even government officials who have been sympathetic with the goals of last year’s Arab Spring protests said they worried about the potential power of a more doctrinaire al-Azhar to stir up opposition to secular governments and institutions.

“The Muslim Brotherhood has been wanting for years to get a hold of it, and once they do, moderate Islam is dead,” said a senior Middle Eastern government official whose country includes millions of Sunni Muslims.

The official insisted that his identity and national origin not be identified, fearing that doing so would incite attacks by hardline clerics. “This is a major challenge to the region.”

Rocky relationships

Despite its long history and reputation, al-Azhar was badly tainted by its close association with a string of Egyptian autocrats, most recently during the three-decade rule of President Hosni Mubarak. When Mubarak was overthrown early last year, al-Azhar emerged weakened and seemingly ripe for a takeover.

That hasn’t happened. Grand Sheikh Ahmed el-Tayib, a Mubarak appointee, has managed to hold on to his job and has become a leading advocate for using dialogue to bridge Egypt’s widening chasm between President Mohamed Morsi and his Islamist backers on one side and the loose coalition of liberals, leftists and Christians who oppose him on the other.

Critics say, however, that Tayib’s survival as grand sheikh owes to his willingness to bow to the new Islamist order.

Al-Azhar’s marble courtyard and graceful minarets have formed the backdrop this year to scenes that would have been unimaginable during the Mubarak era, when Muslim Brotherhood members and Salafis were persecuted for their views.

A string of firebrand preachers, including Hamas Prime Minister Ismail Haniyeh and the hugely popular television personality Yusuf al-Qaradawi, have used the al-Azhar pulpit to inveigh against Israel.

This month, the Muslim Brotherhood made al-Azhar the scene of boisterous funerals for members who were killed in clashes with secular demonstrators.

Several Middle Eastern government officials expressed particular concern over Qaradawi’s sermon, in which he denounced secular Muslim governments across the region and declared that a united Islamic nation would destroy Israel.

“We tell Israel: Your days are numbered,” said Qaradawi, who is a member of the senior al-Azhar council that will interpret the Islamic character of Egypt’s laws. “God might leave the oppressor unpunished for a while, but when the time of judgment comes, there will be no escape.”

A second Middle Eastern government official said he feared that the views of Qaradawi and his ideological kinsmen would eventually hold sway in al-Azhar, regardless of who holds the grand sheikh’s position.

“Sunni Muslims will be under the influence of these voices, not just in the Middle East but in Muslim communities in Europe and around the world,” the official said.

A question of influence

Muslim Brotherhood and Salafi leaders scoff at the notion that they are planning a takeover of al-Azhar and insist they are only interested in ensuring the institution’s independence.

Egypt’s draft constitution guarantees it, and a new law governing al-Azhar dictates that the grand sheikh be selected by the institution’s scholars, not by the president, as was true in the past.

Together, the changes “return Azhar to its original status as an independent institution” after decades of state control, said Essam el-Erian, vice chairman of the Brotherhood’s political wing.

Nader Bakar, a top official with the Salafi Nour Party, denied his group has sought greater influence over al-Azhar.

“We are not interested in freeing Azhar just to take it over,” he said.

Nor, he said, do Salafis want al-Azhar to have the definitive say in interpreting Islamic law.

“Azhar is not like the Vatican,” he said. “No one in Islam has the final point of view.”

Indeed, the draft constitution only gives al-Azhar an advisory role in interpreting the nation’s laws, not a binding one. But legal scholars say the country’s judges and politicians will be deeply reluctant to defy al-Azhar once it has spoken.

At al-Azhar’s modern office complex in central Cairo, where business is conducted by men in Western suits speaking a blend of Arabic, English and French, officials say that Tayib and the 40-member scholars council he leads will be cautious in using their new powers.

“The current imam is keeping us away from this quagmire of politics,” said Ibrahim Negm, an adviser to Tayib, who is also known as the grand mufti.

But the parliament, which will be elected early next year, could try to ease Tayib out, arguing that he’s an unwelcome holdover from the Mubarak era. Negm said hardline Islamists have sought to trash Tayib’s reputation and want to install their own leader.

“If he’s replaced, there will be a big disaster,” Negm said.

Even without a change at al-Azhar, rights advocates worry that Egypt’s new constitution has already started the country down a path that will give religious authorities an outsized role in determining individual rights.

“Making a religious institution responsible for interpreting the law goes against the entire idea of a modern state,” said Ahmed Ezzat, an Egyptian human rights lawyer. “That role ended in the Middle Ages. Trying to restore it now will lead to a wave of oppression.”

Joby Warrick in Washington and Ingy Hassieb and Sharaf al-Hourani in Cairo contributed to this report.