KUNDUZ, Afghanistan — Taliban militants on Friday attacked several districts surrounding the northern city of Kunduz, which briefly fell to them last year. But even as Afghan officials said the security forces had successfully fought off the assault, residents expressed alarm that the insurgents were again at the city’s gates.

The assault on Friday was the first major push by the Taliban after the group declared that its annual offensive had officially begun this week. But in fact, insurgent attacks and battlefield gains continued at a heavy pace all through the winter.

Intense fighting continued in multiple districts of Kunduz late on Friday, and a crucial highway connecting Kunduz to Takhar Province remained blocked. Military aircraft flew constantly over Kunduz city, which remained largely deserted during the day, and airstrikes were reported in the suburbs that had been the launchpads for last year’s insurgent takeover.

“Tonight will be a difficult night for Kunduz,” said Amruddin Wali, a member of the provincial council. “The possibility of the city falling again is there.”