CAIRO — Egypt's top Muslim cleric declared Wednesday that peaceful protests against the president are permitted, in a snub to hard-line Islamist backers of Mohammed Morsi who declared that those behind opposition protests planned for June 30 are heretics.

In a statement, Sheik Ahmed el-Tayeb, the grand imam of the Al-Azhar mosque, stuck strictly to the question of whether Islam allows the protests — while underlining that they must remain peaceful — without weighing in one way or another on their political substance.

Still, the high-profile comment by the influential cleric appeared to be a cold shoulder to Morsi at a time when the president has tried to garner Al-Azhar support, meeting with el-Tayeb as well as the Coptic Christian pope, ahead of the planned protests. On the anniversary of his 2012 inauguration, the Islamist president's opponents are aiming to bring out crowds nationwide demanding Morsi step down and early elections be called.

Morsi has said that while he has nothing but respect for "honorable" protesters, he accused loyalists of ousted autocrat Hosni Mubarak of being behind the planned demonstrations. His hard-line supporters have taken a tougher line, vowing to fight back against any violence by protesters. Some clerics declared those who organize or participate in the protests "kuffar," or heretics, who should be killed.

The June 30 organizers have maintained that the protests would be peaceful, though many on all sides expect clashes to break out if Morsi supporters are also in the streets.

Morsi used an Islamist rally held on Saturday to warn his opponents against the use of violence. Before he spoke, one of the hardline clerics organizing the rally, Mohammed Abdel-Maqsoud, recited an often repeated Muslim prayer against the "enemies" of God and Islam, using it to refer to the June 30 protesters.

Cairo's Al-Azhar is the Sunni Muslim world's foremost seat of learning and styles itself as a voice of moderation. With the political rise of ultraconservatives since Mubarak's fall in Feburary 2011, el-Tayeb and other leading Al-Azhar clerics have actively pushed back against their strict interpretations.

In his statement Wednesday, el-Tayeb said that "peaceful opposition to the legitimate leader is religiously permissible and accepted." Those who commit violence in the protests commit "a grave sin," he said, but even that does not make them heretics who have broken with Islam.

He said Al-Azhar was obliged to speak out after the issuing of fatwas, or religious edicts, "attributed to random arrivals in the field of edicts and jurisprudence," in an implicit jab at hard-line clerics.

The view that those who "rebel against a legitimate leader are kuffar and hypocrites" is only held by groups that have "deviated from the true path of Islam," he said. "The honorable Al-Azhar also warns against declaring opponents non-believers and questioning their faith."

El-Tayeb's statement, posted on Al-Azhar's official website, came a day after he and the patriarch of Egypt's Coptic Christians, Pope Tawadros II, met Morsi. The timing of the meeting suggested that Morsi wanted the public backing of the two religious leaders ahead of the June 30 protests.

Morsi's office said that in the meeting, he "expressed his appreciation ... of how they can contribute to bolstering national unity and maintaining the nation's supreme interests, along with safeguarding the nation's security and stability." The meeting dealt with "current conditions and challenges facing the nation," the statement said.

There have been some tensions between el-Tayeb, who was appointed head of al-Azhar by Mubarak, and Morsi's Islamist backers.

Earlier this year, Morsi supporters stormed el-Tayeb's office to protest an outbreak of food poisoning in a dormitory belonging to Al-Azhar University. The rare protest led to accusations by some el-Tayeb backers that Morsi's Muslim Brotherhood wanted to remove the Al-Azhar imam and replace him with a loyal cleric. The Brotherhood denied that.

Relations between Tawadros and Morsi also have not been smooth. The pope accused Morsi of doing nothing when his patriarchal seat, the Cathedral of St. Mark in Cairo, came under attack by a crowd throwing rocks and firebombs in April, while security forces looked on.

In a television interview aired shortly before Morsi met with the two religious leaders, Tawadros again criticized the Egyptian leader, saying nothing has changed after one year in office to improve the life of ordinary Egyptians. Addressing Egyptians at the end of the interview, the patriarch used heavy symbolism to point to the turmoil roiling Egypt since Mubarak's ouster.

"Don't give up hope even if there is pain. The night always ends and everyone must wait for a better day and better hope," he told his interviewer.

The June 30 protest campaign is rooted in a months-long petition drive called "Tamarod" — or "Rebel" — that claims to have collected up to 15 million signatures on a call for early presidential election. Organizers of the campaign say its success shows how anger at the government and the Brotherhood has transcended the core opposition to the public at large.

Morsi won a four-year term as president with some 52 percent of the vote in a run-off a year ago against Ahmed Shafiq, the last prime minister to serve under Mubarak. He secured the votes of many of the liberal and secular activists who engineered the 2011 uprising and who did not want to see a Mubarak loyalist rule.

Morsi's Muslim Brotherhood, meanwhile, on Wednesday blamed the secular and liberal opposition for a wave of violence the past three days over the appointment of new Islamist governors. Morsi named 17 new provincial governors on Sunday, including seven from the Brotherhood.

The Brotherhood's Freedom and Justice Party said opposition leaders' rejection of Morsi's invitations for dialogue were to blame for the violence in four Nile Delta provinces, the city of Alexandria and two regions south of the capital, Cairo. In those sites, protesters opposed to the new governors have clashed with Islamist supporters. The party statement made no mention of the part played by Morsi supporters in the clashes.

It warned that the violence was a preview of what could happen on June 30, and demanded police take all necessary measures to counter "sabotage and chaos" that day.

Violence erupted anew Wednesday in the oasis province of Fayoum southwest of Cairo, where at least 20 people were lightly wounded when opponents and supporters of the Egyptian president pelted each other with rocks. The violence led to the cancellation of a Brotherhood rally there.