When Maj. Michael Hutchinson, known to his friends as Hutch, redeployed last year to Afghanistan, he was sure — as he later told military investigators — that getting outside the wire to engage in combat was mostly a thing of the past. The Americans were there to train, advise and assist the Afghans. It was their war now. The American combat mission in Afghanistan had ended in 2014, as announced by President Obama in a Rose Garden speech that year. The remaining American forces were supposed to be restricted to two narrow roles: A noncombat NATO training mission, called Resolute Support, was there to advise Afghan forces, while the American counterterrorism force under Freedom’s Sentinel was charged with targeting Al Qaeda and the Islamic State. “The U.S. military will not be engaged in specific operations targeting members of the Taliban just because they’re members of the Taliban,” Josh Earnest, the White House spokesman, told reporters in 2014.

But as the Afghan government has begun to lose ground against the Taliban, United States forces have found themselves pulled back into combat. Since the new missions began in 2015, at least 87 American military personnel have been killed or wounded in action. Much of that fighting has fallen to Special Operations units like Hutchinson’s company, which was assigned responsibility for northern Afghanistan under a task force led by the First Battalion, Third Special Forces Group. (Hutchinson’s name is redacted in the military’s report, but he is referred to throughout as “the G.F.C.,” for ground force commander. His identity was confirmed by Joe Kasper, Representative Duncan Hunter’s chief of staff, who has been in contact with Special Forces who were in Kunduz. The military declined to comment on Hutchinson’s role or make him available for an interview.)

From the start, Hutchinson had been wary of Kunduz and its messy politics. “Ironically, I probably jinxed myself on this,” he later told military investigators. “I said I did not believe that we should get involved in Kunduz any further than [training and advising] unless the provincial capital falls, because structurally it is such a political and ethnic problem. It’s not something that we can effectively weigh in on.”

Kunduz, a fertile wedge of rice and wheat fields tucked between the foothills of the Hindu Kush mountains and the Amu Darya river basin, is one of the provinces where the Taliban have made their biggest inroads in recent years. Yet in the months leading up to the fall of the city, neither the Americans nor the Afghans seemed particularly worried about its stability. On Aug. 13, Brig. Gen. Wilson Shoffner, the United States military’s spokesman in Afghanistan, was asked about the situation there during a news conference. “I think there’s been a lot of generalization when it comes to reports on the north,” he said. “Kunduz is — is not now and has not been in danger of being overrun by the Taliban.”

Roughly six weeks later, around 3 in the morning on Sept. 28, Taliban fighters attacked the city’s outskirts on three fronts. “The mujahedeen were united under one command,” said a Taliban commander who took part in the offensive and goes by the name Shahid. He spoke by phone from outside the city in the weeks after the attack. “We broke our enemy.” Though Kunduz City was home to thousands of Afghan army, police and intelligence personnel, its defenses quickly collapsed, the officers fleeing in disarray to the airport on a plateau overlooking the city. Within hours of their initial assault, the Taliban were freely roaming the streets, looting the abandoned bases of weapons, secret documents, Ford pickup trucks, Humvees and even two old Soviet-­made T-62 tanks. Thousands of residents jammed the highways as they fled to neighboring cities; meanwhile, hordes of Taliban fighters, some from surrounding provinces, streamed into the city, attracted by the prospect of a major victory. It was the first time since 2001 that the Taliban had captured a provincial capital.

As panic spread across northern Afghanistan, the Special Forces were tapped to help save Afghanistan’s fifth-­largest city. There was already one group called an Operational Detachment Alpha — an “A team” of 12 Green Berets, plus some support troops, including joint terminal attack controllers, who direct airstrikes — based at the Kunduz airport. An additional Operational Detachment Alpha, plus four operators from a third one, were sent up from Bagram, the main American military base north of Kabul. They arrived around 6 in the morning on Sept. 29, a little more than 12 hours after the city fell. Hutchinson was put in command of the entire force.

Afghan reinforcements were also flown in, including a contingent of police special forces and about 200 soldiers from the Afghan Army’s most elite unit, the Special Operations Force, which was also known by its Pashto initials, K.K.A., and was formerly attached to the United States military’s secretive Joint Special Operations Command.