Attendees were gathered to mourn a victim of deadly violence a day earlier during protests decrying lack of security.

Three explosions have ripped through a funeral in Afghanistan’s capital, Kabul, killing at least 20 people and wounding 35, according to the health ministry.

Saturday’s funeral at the Tapa Marshal Fahim cemetery in the Sarai Shamali area was being held for a protester, the son of Senator Mohammad Alam Izdyar, who was killed during demonstrations a day earlier demanding better security in the country.

Friday’s protesters took to the streets to decry perceived security failures after a massive blast on Wednesday killed at least 90 people in Kabul.

At least four people died in Friday’s protests, as police fired live rounds to disperse hundreds of demonstrators.

TOLOnews, an Afghan news outlet, posted images to its Twitter feed showing bodies blasted to pieces after the explosions.

The hilly site was littered with bloodied corpses and dismembered limbs, local television footage showed, with one witness telling AFP that “people were blown to pieces” due to the impact of the blasts.

“We don’t know what caused the explosions. Initial reports show 15 people have been killed and wounded,” interior ministry spokesman Najib Danish said on Twitter.

The funeral was attended by senior Afghan government officials including Chief Executive Abdullah Abdullah.

Kabul city was on lockdown on Saturday with armed checkpoints and armoured vehicles patrolling the streets to prevent a repeat of Friday’s protests.

Before the blasts at the funeral, authorities had sealed off roads in the centre of the city, citing the threat of new attacks on large gatherings of people.

READ MORE: Protesters clash with police near Kabul bombing site

“We have intelligence reports that our enemies are trying again to carry out attacks on gatherings and demonstrations,” Kabul garrison commander Gul Nabi Ahmadzai said earlier Saturday.

“We hope that people will stay away from protests.”

But dozens of people still gathered on Saturday under a tent close to the presidential palace calling for Ghani’s government to resign, but the assembly was largely peaceful.

“Any government attempt to disrupt our fair and just demonstration will show their complicity with terrorist groups and the perpetrators of Wednesday’s attack,” said Asif Ashna, a spokesman for the protesters.

“It is the duty of the government to ensure security to the protesters … and the government will be held responsible for any violence.”

Kabul has been on edge since the bombing, which highlighted the ability of fighters to strike even in the capital’s most secure district, home to the presidential palace and foreign embassies that are enveloped in a maze of concrete blast walls.

Residents of the city have demanded answers from the government over the perceived intelligence failure leading to the bombing, which underscores spiralling insecurity in Afghanistan.

Friday’s killings will likely further inflame passions as protesters prepared to attend their funeral ceremonies on Saturday.

The United Nations and a host of international allies have urged the protesters for restraint.

“The enemy seeks to manipulate the people’s anger and sadness to create division and sow instability,” the US embassy said in a statement.

“Now is the time to stand unified and announce to the enemies that Afghans … will not allow cowards to break the resolve to achieve a stable and peaceful nation. The enemies of Afghanistan cannot win. They will not win.”