The mourners were standing in silence by a freshly dug grave Saturday as a mullah recited verses from the Koran. The deceased was a young man who had been killed during a protest against violence in Afghanistan.
Suddenly, a series of three explosions shattered the peace of the day, sending some of the mourners running in panic and leaving others motionless on the ground.
The blasts in the Afghan capital killed at least seven people and wounded 119, the government said, in the latest spasm of violence in the country. Local media reported higher casualty figures, with the number of dead as high as 20.
The funeral was for Mohammad Salem Izedyar, who was killed Friday during antigovernment protests in Kabul as security forces opened fire on demonstrators demanding better security in the wake of a bombing two days earlier that killed at least 90 people and injured hundreds. In addition to Izedyar, the son of a prominent lawmaker, at least four other protesters were killed.
The demonstrators had been largely peaceful, although some reportedly threw rocks at security forces and Kabul's police chief, Gen. Hassan Shah Frogh, said some were armed.
The funeral was attended by a number of high-ranking government officials, among them Chief Executive Abdullah Abdullah and Foreign Minister Salahuddin Rabbani, who both confirmed they were safe after the blasts.
The official casualty figures came from Wahidullah Majroh, a spokesman for the Ministry of Public Health.
Izedyar's father, Mohammed Alam Izedyar, believed the Haqqani network of the Taliban was responsible, although the Taliban had earlier denied its involvement.
"Whenever they kill civilians, they deny it was them," Izedyar, deputy speaker of the upper house of parliament, said in an interview.
He also placed blame on the government. "There was definitely some help from inside the government," he said, although he provided no evidence. "Whenever attacks like these happen, there is someone helping."
"The government has a very weak policy toward the terrorists. They should reconsider it," Izedyar added.
According to Izedyar, the bombs exploded as the people were standing for prayer in the cemetery. "When the mullah uttered the first 'Allahu akbar'" — a prayer that means "God is great" — "the first bomb went off on our left side; five seconds later, the second one on the right. and then the third one in the center."
Ahmad Zia Massoud, President Ashraf Ghani's former special representative for reforms and good governance, was also at the funeral. Massoud had started a sit-in the previous day, calling for the formation of an interim government.
Ghani condemned Saturday's attack and offered his condolences to the victims. "The country is under attack. We must be strong and united," a tweet posted by the presidential palace read. Later, in a live address to the nation, Ghani said reforms would be made in the security agencies "in [the] near future."
On Thursday, commenting on the massive bomb blast that had taken place the day before, Frogh said that terrorist attacks are "normal" and happen all over the world.
Kabul's garrison commander, Gul Nabi Ahmadzai, had warned earlier Saturday that terrorists were planning to attack gatherings and protests in Kabul.
Gunfire was later heard close to Kabul's Emergency Hospital, where the victims were brought and the protesters were still gathered. The source of the gunfire was unclear.
Saturday's bombing is likely to increase demands for security reforms and government officials' resignations.
Liuhto is a special correspondent.
3:50 p.m.: This article has been updated with details on funeral.
10:45 a.m.: This article has been updated throughout with staff reporting, interviews and background.