KABUL — The death toll from an attack Monday on two government office buildings by heavily armed men rose to 43 people, Public Health Ministry officials said Tuesday.

Scores of government workers were trapped inside their offices in a densely populated area of the Afghan capital during a 10-hour firefight, punctuated by a series of blasts, and government troops did not manage to kill the last assailant until just before dawn Tuesday.

“The toll may go up as we are still evacuating casualties,” Public Health Ministry spokesman Waheed Majroh said. Scores of people were wounded in the attack. 

Majroh said most of the victims were employees of the Public Works Ministry and the Ministry for Martyrs and Disabled Persons, which provides services to thousands of war veterans and others affected by conflict. Among the dead were 11 women who worked in those facilities. 

No armed group has asserted responsibility for the attack, the first major violent assault in the capital since last month, when a terrorist bomber killed more than 50 people who had gathered in a hotel to celebrate the birthday of the prophet Muhammad. Taliban insurgents denied any involvement in the Monday attack.

“What is the justification for targeting civilian offices and killing people who are helping the disabled and martyrs’ families?” shouted a man named Shamsullah, who lives near that ministry. “This is very barbaric.”

The attack began with a car bomb outside one ministry. Then a group of gunmen burst into both buildings and roamed among the offices, trapping more than 350 employees.

“They breached the armored door with a rocket,” Abdul Jalil, a survivor, told ToloNews TV. “I was hiding in the balcony. Two men entered our office. One told the other to bring a lighter, and they set the office on fire.”
    Television images showed burned offices with broken computers, and a child-care center in one ministry reportedly came under fire. 

“Attackers appeared from downstairs and were shooting at anyone they saw,” Abdul Aziz, a survivor with a bullet wound in his shoulder, told ToloNews.

Interior Ministry spokesman Najib Danesh said government troops had to act with caution to avoid risking the lives of those trapped or living near the buildings. All roads leading to the area were blocked through Tuesday morning. 

The United Nations Assistance Mission in Afghanistan strongly condemned the attack, saying it had caused “untold human suffering to Afghan families. . . . There is no justification whatsoever for such attacks.” 

Although the Taliban denied any involvement in the attack, the government’s chief executive, Abdullah Abdullah, blamed the group. 

“The Taliban crime syndicate must know that with every attack they carry out against our people, our resolve is further strengthened to eliminate them,” Abdullah tweeted. “Their conduct is a disgrace to the very notion of peace.”

The Taliban has been participating in the early stages of peace talks with U.S. officials and other foreign representatives, although the group has refused to meet directly with Afghan officials. But it has also continued an aggressive campaign of ground attacks across the country.

The attack came just days after President Trump said he was considering pulling out as many as half of the 14,000 U.S. troops serving in Afghanistan. The news stunned the Afghan government, and experts said it could undermine peace talks.

In recent weeks, the Trump administration’s special envoy has aggressively pursued peace negotiations with the Taliban, and meetings have been held that included representatives from the United States, Pakistan and Saudi Arabia, as well as senior Taliban leaders.

The insurgents’ major demand has been the complete withdrawal of U.S. forces and military bases.

The possibility of thousands of U.S. troops leaving has sown confusion and panic in the Kabul government, although aides to President Ashraf Ghani have tried to play down its significance, saying Afghan forces are capable of defending the country.