A bomber detonated explosives in a crowded mosque in the southern city of Kandahar on Wednesday as mourners gathered to pay respects to an assassinated anti-Taliban cleric.
Among those killed was the chief of police from the capital, Kabul.
Interior Ministry spokesman Lutfullah Mashal said on Thursday that the dead bomber was a foreign national, most probably an Arab.
There was no claim of responsibility for the attack - Afghanistan's first blast at a mosque and the most serious in a recent spate of violence.
The governor of Kandahar province, Gul Agha Sherzai, said that Osama bin Laden's al-Qaida was responsible.
During the 1996-2001 rule of the Taliban, hundreds of Arabs came to Afghanistan to join al-Qaida. Some are still with anti-government fighters on the Pakistan border.
President Hamid Karzai stopped short of blaming a particular group.
Condemning the attack as "an act of non-Muslim and defeated terrorists", he called on Afghans to be vigilant and "not allow foreigners to conspire against their national security".
Taliban denies role
Mourners at the mosque had gathered for the funeral of Mawlavi Abdullah Fayaz, a prominent critic of the Taliban who was killed on Sunday by armed men on a motorcycle.
The Taliban, battling US and Afghan government troops since their 2001 ouster, claimed responsibility for killing Fayaz but denied involvement in Wednesday's blast. A Taliban spokesman condemned attacks on places of worship.
Kandahar's governor suspects
al-Qaida over the bombing
Mashal declined to say which group was suspected of responsibility, saying the investigation was under way. But he said an increase in attacks, including bombs in Kabul, showed the enemies of Afghanistan were getting desperate.
"The enemies of peace and stability have been defeated in the front line of war and now they're focusing on soft targets, charity organisations, aid workers and religious scholars," he said.
Attacks on mosques in Afghanistan are rare, and until recent years were unheard of.
Afghanistan has not seen the sort of rivalry between majority Sunni Muslims and minority Shia that has led to numerous blasts at mosques and shrines in neighbouring Pakistan.
The Kandahar bomber wore a police uniform, survivors said. He had walked into the crowded mosque by mingling with Kabul police chef Akram Khakreezwal's security men as they entered with him.
Aid agencies and diplomatic missions have said they have received warnings of plots to stage attacks, by bombers in cars or on foot, in Kabul and elsewhere.
A bomb in a Kabul Internet cafe in May killed three people, including a UN worker from Myanmar. An American woman and an Afghan girl were killed by a bomber in October.
Four German peacekeepers were killed in a car bomb attack in Kabul in June 2003.