KABUL, Afghanistan — Outgunned and surrounded by Taliban fighters in a chronic combat zone of southern Afghanistan, the police officers and soldiers thought they had negotiated passage to safety. They had walked into a trap.

In what appears to be one of the worst massacres of Afghan forces in a protracted and forgotten war, at least 100 were killed when the Taliban fighters opened fire on them from all directions as they tried to flee through the agreed-upon retreat route, Afghan officials said Wednesday.

Accounts of the massacre, which happened Tuesday near the southern city of Lashkar Gah in Helmand Province, punctuated a growing crisis in Afghanistan’s armed forces that goes to the heart of their sustainability: They are sustaining enormous casualties from a revitalized Taliban insurgency and are facing increased problems recruiting. Many vacancies go unfilled.

The Taliban insurgents have opened simultaneous fronts across the country in recent months, overrunning districts and besieging major urban centers. The insurgents managed to easily capture parts of Kunduz for a second time on Oct. 3, and hold them until finally forced to retreat on Wednesday after a week of devastating urban battles that displaced tens of thousands of people.