KABUL — A barrage of rockets struck a handful of neighborhoods in the heart of the Afghan capital Saturday morning, killing eight people and wounding 31. The rockets slammed into small businesses, a school, residential buildings and one embassy, sending plumes of smoke and dust into the air.

The rocket attack, the largest for Kabul in years, comes as security is deteriorating in the Afghan capital, despite a peace deal signed between the United States and the Taliban and ongoing peace talks between the Taliban and the Afghan government in Doha. Secretary of State Mike Pompeo was in the Qatari capital on Saturday meeting with both negotiating teams.

The Taliban issued a statement denying any involvement. The group in a tweet said it does “not allow indiscriminate strikes in populated areas.” Later, an Afghan faction linked to the Islamic State issued a statement claiming responsibility for the attack, according to SITE Intelligence Group, which monitors extremist activity online.

Past rocket attacks in Kabul have targeted the presidential palace compound and other government buildings.

Afghanistan’s Interior Ministry said 24 rockets were fired into downtown Kabul from two vehicles during Saturday’s morning rush hour. Most of the rockets hit residential areas in the capital, the ministry said, and all of the casualties were civilians. One rocket hit the Iranian Embassy, causing damage but no casualties, according to a tweet from the embassy.

A video posted to social media showed the aftermath of the rocket that hit a school in Kabul. Crowds of students could be heard screaming, running down a narrow street away from the blast.

“I heard boom, at least four, then I heard the neighbors screaming,” said Ahmad Farid Amiri, the owner of a bakery in downtown Kabul. One of the rockets hit his bakery’s delivery van, wounding three employees. “It was a horrific incident,” he said.

Since the Taliban signed a peace deal with the United States in February, large-scale bombings claimed by the group no longer regularly shake Kabul. But the capital and other parts of Afghanistan have seen a sharp increase in other kinds of attacks by militants — both by the Taliban and the rival Islamic State — such as mass shootings and targeted killings.

Taliban fighters waged offensives in southern Afghanistan in recent weeks, and in the north, the militants have repeatedly pushed closer to Kunduz’s provincial capital. And earlier this month, gunmen stormed Kabul University, killing at least 22. Responsibility for that attack was claimed by the Islamic State.

Saturday’s attack happened two days before a major donor conference for Afghanistan in Geneva. Afghanistan remains heavily dependent on foreign aid to provide citizens with basic services and keep the country’s security forces running. Donors are expected to pledge less aid this year amid uncertainty surrounding peace talks.

Since the Doha talks launched in September, the two sides have struggled to reach an agreement on the ground rules that would allow them to move on to discuss substantive issues. The aim of the talks is to agree on a power-sharing government, but it’s unclear what form that government would take and whether gains made in the areas of civil liberties and human rights over the past 19 years will be protected.