KABUL — On a stony hilltop at the edge of a city in shock, 10 coffins were lowered into a freshly dug trench Thursday and covered with dirt and stones by a waiting bulldozer. Ten thin slabs were marked in white paint with first names — Farzana, Ataullah, Ali — and planted in a shallow row as several hundred mourners watched in silence.

The dead were students in their teens and 20s, victims of a suicide bombing Wednesday in the capital for which the Islamic State militia asserted responsibility the following day. Officials said the blast, inside a college preparatory center in the capital’s minority Shiite and ethnic Hazara community, killed 34 people and wounded 57 others. The death toll has been revised several times amid confusion at hospitals. 

While friends and relatives were holding ceremonies for the blast victims, a group of armed men attacked a training compound operated by the national intelligence agency in another area of Kabul. Gunfire and explosions continued for several hours during the attack, which police said was staged from a nearby construction site. Authorities said three attackers were killed. No casualties on the government side were reported.

The two attacks came amid an accelerating spate of violence, notably a deadly, four-day siege by Taliban fighters of the eastern city of Ghazni. The bloodshed has increased public fear and frustration with the Afghan government and dimmed Afghan and U.S. hopes to build on a cease-fire with the Taliban in June and an exploratory meeting between Taliban and U.S. diplomats last month.

Among mourners at several funerals Thursday — including friends and relatives of the slain students, as well as strangers who felt the need to be there — the sense of grievance was specific, acute and expressed in increasingly angry terms. Some muttered about ethnic genocide, government conspiracies and the need to defend themselves. 

Others expressed a deeper, enduring worry that has been spreading across the city’s Shiite and Hazara populace in the past several years, as Sunni Islamist militants have bombed and shot at a succession of mosques, shrines, religious processions, public rallies and education centers in their urban enclaves. 

It is the growing sense, voiced in numerous interviews this week, that an entire generation of young Hazaras is under threat. Many Hazaras say that the best and brightest members of their long-suppressed, predominantly Shiite ethnic group — now beginning to compete with more-dominant groups in professions, education and politics — not only are being targeted by outside religious adversaries but also are underprotected by the Afghan government. 

“There is no security for us,” said Soraya Samar, 19, a student who addressed the mourners from a bullhorn as she stood on top of a truck. “Every time an incident takes place, we ask for more security, but nothing changes. The government has done nothing to protect us since Deh Mazang.”

Samar was referring to a peaceful protest staged by Hazara students and young people just over two years ago at a traffic circle in Kabul. As a crowd of several hundred gathered, a suicide bomb exploded in their midst, killing more than 80 people and wounding many more. Some of the young Deh Mazang victims were buried in the same hills as those who died Wednesday.

In a statement Thursday, the human rights group Amnesty International denounced Wednesday’s bombing as a “war crime” that was apparently “motivated by sectarian hatred.” 

To many, Wednesday’s attack on the Mowud learning center was another assault on the educational and professional aspirations of Shiite Hazaras. Many people noted Thursday that the center had built an exceptional record, with large numbers of its students scoring high marks on national college entrance exams. Now, some parents say they fear sending their children there.

“As a father, the thing I care most about in the world is my kids’ education. We are living in a democracy now, and the things of learning should replace guns and violence and blood,” said Amir Jafferi, 42, a small-business owner in Kabul with three teenage children. “If education comes under attack, then there is no solution to our problems, and the violence and bloodshed will return.”

Jafferi, who like many Afghan Shiites spent years as a war refugee in Iran, said he had been planning to send his oldest daughter to Mowud for college prep classes. But now he is rethinking that decision.

For the first time since returning home, he said, “I have a feeling of darkness for the future and for the future of my children.” 

Sharif Hassan and Sayed Salahuddin contributed to this report.