KABUL, Afghanistan — Powerful explosions outside a high school in Afghanistan’s capital on Saturday killed at least 30 people and wounded dozens more, many of them teenage girls leaving class, in a gruesome attack that underscored fears about the nation’s future after the impending American troop withdrawal.
The blast — and the targeting of girls as they left the Sayed Ul-Shuhada high school — came as rights groups and others were expressing alarm that the American troop withdrawal would leave women, and their educational and social gains, particularly vulnerable.
The hope surrounding the U.S. deal with the Taliban on the troop withdrawal was that it might open the way for a lasting cease-fire and a respite for civilians who are being killed in horrific numbers. But the reality as American troops depart is being driven home by massacres like the one on Saturday — there has been more chaos than accord, and more fear than hope.
Details of the attack were murky. It was unclear if it was a coordinated assault or if it had involved car bombs or a suicide vest — or a combination of all three. But ambulances raced across the city toward the site into the evening.
In recent weeks, the Taliban’s public statements have mostly been triumphal, leaving many fearing that the insurgents will try to seize power through a bloody military victory with the American and international forces gone.
Even if some peace deal were to be reached between the Afghan government and the Taliban, something that appears less likely each day, the result would still be that the Taliban’s brand of harsh Islamist strictures, including keeping girls out of school, could again become the mainstream.
On social media, the Taliban denied responsibility and condemned the attack, which happened in a Western district of the capital where many residents are of the Hazara ethnic minority. The Hazara are a mostly Shiite group in a country rampant with Sunni militants, and they have been frequent targets of Islamic State loyalists. The Hazara, too, are growing increasingly outraged at the violence against them and at the government’s inability to protect them.
Sayed Ul-Shuhada hosts classes for boys in the morning and for girls in the afternoon. The attack occurred around 4 p.m., as the girls were leaving and the streets were packed with residents preparing for the end of the holy month of Ramadan.
Many residents saw the massacre, which left books and backpacks and bodies scattered across the ground on what had been a pleasant spring afternoon, as a foreshadowing of what is to come.
Dr. Mohammad Dawood Danish, the head of the Mohammad Ali Jinnah hospital in Kabul, said that 20 bodies and more than 40 wounded people had been transferred to his hospital. Most of them were students, he said.
“The health condition of a number of girls is critical,” Dr. Danish said. Tariq Arian, a spokesman for the Interior Ministry, said 52 people had been wounded in all.
The presidential palace in Afghanistan, in a statement, blamed the killings on the Taliban, calling them “a crime against humanity.”
The attack on Saturday, for all its brutality, represented something that has become painfully common in Kabul, a capital city that has been rocked by terrifying violence — suicide vests, rocket barrages, huge truck bombs — for years.
But the attack on the Sayed Ul-Shuhada high school came at an inflection point, as U.S. and international forces leave and the next chapter of Afghanistan’s enduring war begins to unfold.
“I have lost count of attacks harming children,” Shaharzad Akbar, the chairwoman of the Afghanistan Independent Human Rights Commission, said on social media. “I have lost count of attacks on education. I have lost count of civilians killed even just this month. This war must stop. This madness, this hurt, this pain.”
Mohammad Hussain Jawhari, a resident of the area, said three rockets had been fired at the gates while the girls were leaving the school. Another witness said the blasts had been caused by several car bombs. Mr. Arian, the Interior Ministry spokesman, said the nature of the explosion was unclear.
“I am on my way to the hospital — two relatives are missing,” Mr. Jawhari said. “I checked at least 10 hospitals, and they were nowhere to be found. People have gathered in the area. They are really angry. It is not for the first time that our kids get blown up and the government doesn’t do anything.”
Sayed Ahmad Hussaini had arrived to pick up his two daughters and saw a man sitting in a Toyota sedan parked outside the school and shaking from what he thought was nervousness. Mr. Hussaini said he asked the man what he was doing. “None of your business,” the man in the car replied.
Moments later, the car exploded, Mr. Hussaini said.
Peace talks in Qatar have given little assurance that the war might soon end, and the Taliban have shown no sign of wanting to amicably join the current government. The Islamic State is still quietly entrenched, mostly in the country’s east, and is waiting for an opportunity to reassert itself.
Caught in the middle is a generation of Afghans who have grown up over the 20 years since the U.S. invasion in 2001. The international community championed women’s rights and human rights more broadly in the country after the fall of the Taliban. Now the future of both is unclear.
When the insurgent group governed Afghanistan from 1996 to 2001, it barred women and girls from taking most jobs or going to school.
Roshan Ghaznawi, a women’s rights activist in Kabul, was driving home when she heard about the attack, and she soon started crying.
“For three years now, our education centers have been the target of bloody attacks,” Ms. Ghaznawi said. “This is not the first attack, and it will not be the last, but we will never give up. If 30 people were killed in this incident, now the hearts of 30 million people are wounded, and the hearts and souls of 30 million people are in pain.”
In October, a suicide blast at an education center in the same neighborhood as Saturday’s attack killed at least 24 people, again many of them students.
The attack came at the end of a particularly violent week in Afghanistan. The Taliban have started offensives in the south and the north after the start of the withdrawal of U.S. and NATO troops. Last week, a car bomb in Logar, a province just south of Kabul, killed more than 20 people.
At least 44 civilians and 139 government forces were killed in Afghanistan in the past week, the highest weekly death toll since October, according to data gathered by The New York Times.
Fatima Faizi and Kiana Hayeri contributed reporting.