More than 100 were wounded in the attack, which hit the funeral of one of five people killed when police fired on a march against deteriorating security.
The chief executive of Afghanistan, Abdullah Abdullah, survived the attack.
The latest violence comes as much of Kabul is in lockdown and amid popular anger at the government.
Officials had warned people to stay away from demonstrations, saying they might be attacked by militants. Checkpoints have been set up in central Kabul, and armoured vehicles are patrolling the streets.