Suicide bombers have killed at least seven people at the funeral in Kabul of a man who died during a protest on Friday, Afghan officials say.
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.
In a televised address, Mr Abdullah said three suicide bombers were among the mourners attending the funeral of a senator's son who was killed in Friday's protest.
He said that an investigation must determine how the attack happened. No group has said it was behind it and the Taliban denied their involvement.
President Ashraf Ghani said on Twitter: "The country is under attack. We must be strong and united."
He later said: "We must not let ourselves fall into the trap that the enemies have spread to our country."
Rahmatullah Begana, who was at the funeral, said the first explosion went off at the start of the ceremony.
"A few minutes later, there was another explosion. I saw a lot of people on the ground covered with blood," he said.
Another witness told AFP news agency that "people were blown to pieces".
Anger on the streets: By Secunder Kermani, BBC News
Kabul has now had three deadly incidents in four days. Residents are still reeling from the aftermath of the huge suicide attack which killed over 90 people earlier this week.
Anger at the government for not doing more to prevent that attack led to protests on Friday. Now the funeral of one of those victims has been targeted, presumably by a militant group.
A number of high-profile politicians were present at the funeral today. The fact that even they are not immune to the rising violence shows the scale of the threat in the city.
Kabul was once considered the most secure part of Afghanistan. Now it seems the most dangerous.
Friday's protest followed a bomb attack on Wednesday which killed 90 people in the city's diplomatic district.
Afghan intelligence officials have blamed the Haqqani network, a Taliban affiliate with alleged links to Pakistan.
The Taliban denied any role and there has been no comment from so-called Islamic State militants, who are usually quick to claim attacks.
More than a third of Afghanistan is now said to be outside government control.
The US has about 8,400 troops in Afghanistan, while another 5,000 from Nato allies are in the country.