Saudi Arabia's powerful crown prince vowed to "pursue terrorists until they are wiped from the face of the earth" as officials from 40 Muslim countries gathered Sunday in the first meeting of an Islamic counter-terrorism alliance.

"In past years, terrorism has been functioning in all of our countries... with no coordination" among national authorities, Prince Mohammed bin Salman, who is also the Saudi defence minister, said in his keynote speech at the gathering in Riyadh.

"This ends today, with this alliance."

The summit is the first meeting of defence ministers and other senior officials from the Islamic Military Counter Terrorism Coalition, which officially counts 41 countries and identifies as a "pan-Islamic unified front" against violent extremism.

The alliance was announced in 2015 under the auspices of Prince Mohammed, whose rapid ascent since his appointment as heir to the throne in June has shaken the political scene across the region.

The alliance groups largely, although not exclusively, Sunni-majority or Sunni-ruled countries.

It excludes Saudi Arabia's arch-rival, Shiite-dominated Iran, as well as Syria and Iraq, whose leaders have close ties to Tehran.

Sunday's meeting coincides with an escalation in tensions between Riyadh and Tehran, particularly over wars in Syria and Yemen and the political structure of multi-confessional Lebanon.

The meeting also comes as several military coalitions, with backers including both Iran and key Saudi ally the United States, battle to push the Islamic State group from its last remaining bastions in Iraq and Syria.

Retired Pakistani general Raheel Sharif has been appointed commander-in-chief.

The alliance aims to "mobilise and coordinate the use of resources, facilitate the exchange of information and help member countries build their own counter-terrorism capacity," Sharif said.

While the alliance officially includes Qatar, which is the target of a six-month boycott led by Saudi Arabia, organisers in Riyadh said no Qatari officials were present at the meeting.

Qatar's flag was also absent.

Saudi Arabia, the UAE, Egypt and Bahrain abruptly cut diplomatic and trade ties with Qatar in June, accusing the emirate of being too close to Iran and supporting Islamist extremism.

Qatar denies the allegations.

Egypt, which sent a military official and not its defence minister to the Sunday meeting, is reeling from a Friday attack on a mosque that killed more than 300 people during prayer time.

While IS has not claimed responsibility, Egyptian authorities say the organisation is the main suspect as the mosque is associated with followers of the mystical Sufi branch of Sunni Islam, whom IS has branded heretics.

Prince Mohammed said Friday's "painful event" was a reminder of the "danger of terrorism and extremism".

"Beyond the killing of innocent people and the spread of hatred, terrorism and extremism distort the image of our religion," he said.

Since his sudden appointment as crown prince, Prince Mohammed has moved to consolidate power, announcing crackdowns on both terrorism and corruption.

A corruption purge saw around 200 Saudi elites including princes, ministers and business tycoons arrested or sacked earlier this month.

Saudi Arabia's powerful crown prince vowed to "pursue terrorists until they are wiped from the face of the earth" as officials from 40 Muslim countries gathered Sunday in the first meeting of an Islamic counter-terrorism alliance."In past years, terrorism has been...