"It is with deep regret that we have learnt the death of the outstanding scholar, Sheikh Mohamed Sayed Tantawi, who died of a heart attack," the message said.
"At this painful time, we express to your Excellency (..) and the brotherly Egyptian people our sincere condolences and compassion," HM the King said, adding that the Islamic Umma has lost a prominent imam known for his avant-garde role in spreading the real values of Islam.
Al-Azhar has always been, thanks to such Muslim clerics, a beacon for science, culture and Islamic civilizations, the sovereign said.
The monarch also extended, on his behalf and that of the Moroccan people, his heartfelt condolences and sympathy to the relatives of the departed who devoted his life "to serve Muslims, spread the teachings and precepts of Islam, make the word of God prevail and defend the religion's noble causes."