Syrian state media said the central Damascus attack during the busy evening hours Thursday was a suicide bombing carried out by "mercenary terrorists against the Syrians."
Some opposition groups said the blast, heard and felt for several miles, was a car bombing.
The dead cleric was Mohammad Said Ramadan al-Bouti, 84, the government-appointed imam of the eighth-century Omayyad Mosque, also known as the Great Mosque of Damascus, the largest and most important Sunni mosque in Syria.
Bouti was teaching a religious class at another mosque, Syrian TV said.
Among those killed was Bouti's grandson, the TV said.
"This massacre adds to the crimes perpetrated by the mercenary terrorists against Syrians," the official Syrian Arab News Agency quoted President Bashar Assad's Baath Socialist Party leadership as saying in a statement.
"They target everything including the mosques and houses of worship," the statement said.
The opposition Free Syrian Army denied responsibility, saying it would never target a mosque.
"This is not a method the FSA would use," the FSA's Damascus Military Council said in a statement. "It would not hit a mosque even if an important target were inside."
But the opposition Syrian Observatory for Human Rights said extremist elements within the opposition may be responsible.
"The Syrian regime definitely did not do this [mosque attack]. This was probably the work of Islamist groups within the opposition," The Wall Street Journal quoted an Observatory spokesman as saying.
Washington and other Western powers have expressed growing concerns about Islamic extremists reputed to be increasing in number among opposition fighter ranks.
No group claimed immediate responsibility for the attack.
Bouti's early support for the regime during the 2-year-old war was widely considered crucial to Assad's legitimacy because the insurgency has drawn largely from Syria's majority Sunni population.
Assad is a member of the minority Alawite sect, a Shiite Islam offshoot, and his closest advisers and loyalists are Alawites.
Still photos aired by the official Syrian al-Ikhbariya TV news channel showed bloody bodies of men sprawled across the mosque's carpeted floor.
The blast came hours after the United Nations said it would investigate accusations chemical weapons were used in an attack Tuesday that killed 26 people in northern Syria's Aleppo province.
Secretary-General Ban Ki-moon said the probe would begin soon, and he called on all sides in to allow "unfettered" access to the U.N. team.
A preliminary U.S. assessment of the Aleppo attack found no evidence chemical or biological weapons were used, U.S. officials said.