President Karzai described the first suicide attack on an Afghan mosque as “an act of non-Muslim and defeated terrorists”.
Afghan authorities blamed the attack in the southern city of Kandahar on Osama Bin Laden’s al-Qaeda network.
A man claiming to speak for the Taliban telephoned the BBC in Kabul to say the organisation had carried out the attack. However another Taliban spokesman, Latifullah Hakimi, later denied the group had been involved.
It was the country’s worst attack this year and one of the most serious since the fall of the Taliban, who claimed Kandahar as their birthplace and who have stepped up attacks in recent months.
Mourners had gathered for the funeral of Mawlavi Abdullah Fayaz, a supporter of President Karzai and prominent critic of the Taliban, who was killed on Sunday by gunmen on a motorcycle.
Last month, he had condemned the Taliban at a meeting in Kandahar of about 500 clerics. He said their fighters were killing innocent civilians and the government should be supported for trying to rebuild the country.
Among those who died on Wednesday was the police chief of the capital Kabul, Akram Khakreezwal.
A witness told the AFP news agency the bomber, dressed in a police uniform, approached Mr Khakreezwal and detonated his device.
Hundreds of people were inside the mosque at the time of the blast.
The attack raises fears the Taliban is stepping up a renewed onslaught which has left more than 250 people dead this year.
Attacks on mosques in Afghanistan are rare, and until recent years suicide attacks were unheard of.
Afghanistan has also not seen the sort of rivalry between majority Sunni Muslims and minority Shi’ites that has led to numerous blasts at mosques and shrines in neighbouring Pakistan.
United Nations Secretary General Kofi Annan strongly condemned Wednesday’s suicide bombing.
His spokesman said he was shocked and angered by what he called a “senseless attack” and “strongly condemns this heinous act of terrorism”.