Sheikh Ahmed al-Tayeb of Cairo's al-Azhar University said that a historical misreading of the Koran had led to intolerant interpretations of Islam.
Speaking at an anti-terror conference, he called for unity among Muslims.
Egypt's President Abdel Fattah al-Sisi has said that a pan-Arab military force is needed to combat terrorism.
He told Egyptian state TV that the need for such a unified force was "growing and becoming more pressing every day" because of the huge challenges faced by the region.
"We will be able to overcome such challenges when we unite together," he said.
Mr Sisi added that several countries, including Jordan, Saudi Arabia and the United Arab Emirates, had offered military assistance against Islamic State (IS) after the militants released a video that appeared to show the beheadings of 21 Egyptian Christians.
The beheadings prompted Egypt to bomb alleged IS targets in Libya.
President Sisi said that the Egyptian military had no interest in attacking or invading other nations but that it would defend Egypt and the region.
Sheikh Ahmed al-Tayeb condemned terrorism at the opening of a three-day counter-terrorism forum in the holy city of Mecca in Saudi Arabia.
In his speech, he linked extremism to "bad interpretations" of the Koran and the life of the Prophet Muhammad.
"The only hope for the Muslim nation to recover unity is to tackle in our schools and universities this tendency to accuse Muslims of being unbelievers," he said.
Saudi Arabian King Salman said that terrorism was a "threat to our Muslim nation and the entire world", in a statement read at the conference.
"Terrorism is a scourge which is the product of extremist ideology," he added.
The conference, attended by senior clerics from across the Muslim world, will focus on Islam and the fight against terrorism.