An Afghan soldier keeps watch at a checkpoint in Herat in western Afghanistan on Tuesday. (Aref Karimi/AFP/Getty Images)

Afghan forces backed by U.S. air power expelled most Taliban insurgents from the northern city of Kunduz on Tuesday, protecting government buildings and retaking the central square after insurgents occupied it Monday. Officials said they were still searching for insurgents and accomplices hiding in residential areas.

Fighting also continued for a second day in southern Helmand province, where Afghan forces drove Taliban militants from the capital of Nawa district but other insurgent squads attacked the capital of Khanshin district. In nearby Uruzgan province, Taliban forces launched attacks on roads leading to the capital, Tarin Kot, officials said.

Insurgent violence Tuesday also took the life of an American service member in eastern Nangahar province. U.S. military officials said he died from wounds inflicted by an improvised explosive device that detonated while he was on patrol with Afghan forces.

The patrol in Achin district, near the Pakistan border, was part of a counterterrorism operation against Islamic State-Khorasan insurgents who have been active there for the past year. U.S. military officials did not immediately identify the victim.

The surge of scattered aggression from insurgents created an impression of widening insecurity, Taliban persistence and military weakness, just as top Afghan leaders arrived in Brussels for an international conference where they hope to persuade donors to support the struggling government by pledging $15 billion over the next five years.

There have been indications from some donor nations that international generosity and patience with Afghanistan’s seemingly endless war are wearing thin. Peace talks with the Taliban collapsed last year, and the insurgent group has strongly denounced a peace deal signed last week between Afghan leaders and the fugitive militia leader Gulbuddin Hekmatyar.

The new assault on Kunduz was especially troubling because Taliban forces had captured the strategic city a year ago and held it for more than a week, dealing a major psychological blow to the U.S.-backed war effort. On Tuesday, the fighting there forced officials to cancel a memorial ceremony for 42 victims of a U.S. airstrike that mistakenly hit a hospital during the battle last year.

Shops were shut and streets were empty Tuesday. An Afghan special operations soldier spoke live on Tolo television from the city’s deserted main plaza, where Taliban videos and Facebook posts the day before had shown men with turbans and assault weapons strolling and at ease.

U.S. military officials in Kabul confirmed that sporadic fighting was continuing in Kunduz, but they said the government was in control of the city. They said that one U.S. helicopter had fired “to defend friendly forces” and that other U.S. military assets had been brought to the area and were ready to assist Afghan forces. Afghan officials said three troops had been killed.

“U.S. forces continue to maintain robust enablers in Kunduz and will provide support as needed,” said Brig. Gen. Charles Cleveland, the chief spokesman for the U.S. military advisory and assistance command in Afghanistan. He called the situation in Kunduz “fluid.”

A spokesman for the Afghan Defense Ministry, Mohammad Radmanesh, said Tuesday that “the enemy has been pushed back, and we are conducting a mopping-up operation in suspected areas where we think they are hidden.”

Radmanesh also said that officials were in the process of identifying and arresting “some thieves and villains who helped the Taliban.” He described them as “the sort of people who try to create anarchy and disorder for their own interests.”

But Alhajullah Nazar, a legislator from Kunduz, said Tuesday afternoon that some neighborhoods were still under Taliban control and that civilians there were trapped in their houses. He also said some residents had helped the insurgents enter the city, surprising security forces conducting anti-Taliban operations in the suburbs.

There were reports that the police chief and the provincial governor had fled Kunduz and that local police had abandoned their posts. The confusing picture recalled reports after the 2015 attack that the Taliban may have been aided by collaborators. The area is rife with violence and rivalries among ethnic groups, smugglers and a mix of local security forces. 

Taliban forces were also reported to have launched assaults in Baghlan province Tuesday and cut off roads to Kunduz from there and other provinces, but officials said the insurgents were repelled.

In Helmand’s Khanshin district, officials said the capital was back under government control by Tuesday evening, but there were reports that local police had fled.