The Taliban attacked the Afghan police compound at first light, coming from all sides at the American Green Berets holed up inside. The insurgents fired assault rifles, heavy machine guns and rocket-propelled grenades. They came in what a soldier called “human waves.”

Not even strafing runs by American F-16 fighters stopped the assault. The elite American soldiers — whose mission was only to train and advise Afghan troops — had never seen a firefight as intense.

Holding the compound, another soldier said, took an “Alamo defense.”

On the morning of Oct. 1, about 30 soldiers were in close-quarters combat against Taliban fighters — even though White House and Pentagon officials have repeatedly insisted that American troops no longer play that role.

The Americans were not ambushed while advising local forces behind the front lines or struck by rocket fire while manning a fortified base. Nine months after President Obama declared an end to the American combat mission in Afghanistan, these Green Berets were at the leading edge of an offensive to retake Kunduz, where Afghan forces had melted away as insurgents attacked, leaving an entire city in the Taliban’s grip for the first time since 2001.

The fight for the police compound proved crucial in rallying Afghan forces to retake the city.

It also offered the starkest example to date of a blurry line in Afghanistan and Iraq between the missions that American forces are supposed to be fulfilling — military training and advising — and combat. Mr. Obama has portrayed that combat role as over. But as the Taliban in Afghanistan and the Islamic State in Iraq have threatened the delicate stability he hoped to leave behind, American forces are increasingly being called on to fight.

The fall of Kunduz “was clearly a desperate situation,” said Brig. Gen. Charles H. Cleveland, the spokesman for the American command in Afghanistan. The soldiers, he said, recognized that “if we don’t really provide some very strong suggestion, direction, whatever you call it — if we don’t get engaged with this quickly — we’re going to have a much larger issue.”

In interviews with military investigators, Green Berets who fought in Kunduz for the four days it ultimately took to begin securing the city provided a graphic and previously undisclosed account of one of the most important engagements of the war. The investigators’ main purpose was to examine not that battle, but the tragedy that stemmed from it. It was these Green Berets who, on the morning of Oct. 3, in the heat of battle, called in the airstrike that killed 42 people at a hospital in Kunduz run by Doctors Without Borders, prompting an international outcry and disciplinary action against 16 military personnel.

The investigators wanted to know how the strike occurred. But the interviews they conducted also revealed almost universal confusion among the Green Berets over their exact mission in Kunduz. The goal was simple: not to lose the city. But in a reflection of the ill-defined parameters of the United States’ mission in Afghanistan, no one involved in the battle seemed to know how far the group was supposed to go to ensure success.

Photo

The Doctors Without Borders hospital about a month after the airstrike.CreditNajim Rahim/Agence France-Presse — Getty Images

When soldiers sought guidance from commanders in Kabul, “the only sounds audible were the sounds of crickets,” a Green Beret officer said, adding, “Though those were hard to hear over the gunfire.”

At the outset of the battle for Kunduz, Peter Cook, the Pentagon spokesman, said Americans were using force only to defend themselves in accordance with the rules under which Mr. Obama had agreed to keep troops in Afghanistan. American soldiers, Mr. Cook said, were “not directly engaged in the fight.”

The report on Kunduz is heavily redacted; roughly two-thirds of its more than 3,000 pages remain classified, as do the names of the soldiers interviewed. But the publicly released portions tell a far different story.

The fighting was so fierce that American aircraft launched 22 airstrikes over four days. A Green Beret called it a “miracle” that all of the Americans survived.

Chaos at the Airport

The swift fall of Kunduz to the Taliban on Sept. 28 stunned American commanders, who hastily dispatched more Army Special Forces, as the Green Berets are formally known, to reinforce a 12-man “A Team” that was based near an airport south of the city.

The first American reinforcements arrived early the next day. They had planned to push into the city that night with whatever Afghan forces they could muster. They instead spent the night fending off a Taliban attack on the city’s airport after the Afghan police guarding the perimeter ran from their posts.

A Special Forces major arrived in the middle of the attack. As he got off the helicopter, the major recalled, he was told, “They’re abandoning the perimeter, and the base is about to fall.”

It was a chaotic scene. Hundreds of police officers and civilians who had taken refuge at the airport were fleeing into the darkness.

Teams of Green Berets rushed to secure the control tower while others fought off the advancing Taliban, some of whom were charging toward the runway in Humvees captured from Afghan troops in Kunduz. The Americans were later joined by Afghan units that had been “emboldened by the U.S.S.F.’s assertive and quick actions,” the investigators said, using an abbreviation for United States Special Forces.

Photo

An 8-year-old girl was comforted by a nurse at the hospital on Oct. 3, shortly after the airstrike. American soldiers thought they had attacked the Taliban, but military investigators later described the strike as “a disproportional response to a threat that did not exist.”CreditVictor J. Blue for The New York Times

The next day there was a videoconference with the top Afghan general at the airport and Gen. John F. Campbell, the American commander in Afghanistan at the time. It went poorly.

Continue reading the main story

The Afghan general answered “questions that were not the ones that General Campbell was asking,” the major recalled. “General Campbell was somewhat upset.”

So the major spoke up. And with that, the operation to retake Kunduz became an American plan.

The American officers quickly agreed that the Afghans lacked urgency and that they needed to get into the city as fast as possible. They decided that the Americans and the Afghans would move into Kunduz that night.

The specifics — such as what legal authority would govern the American mission — were left unaddressed. Some American troops in Afghanistan conduct raids against militants from Al Qaeda and the Islamic State. But fighting the Taliban is now supposed to be the job of Afghan forces, not Americans.

Reflecting on this, the major said that “General Campbell was very much in a hurry to get back to D.C.” — where he was due to meet with President Obama and testify before Congress.

Before the assault, the major told his troops that “the whole world is watching.” It would soon be true, but not for the reasons he had expected.

Heading Into Kunduz

The American and Afghan forces set out around 11 p.m. on Sept. 30 and quickly encountered Taliban resistance. American aircraft conducted five strikes between 12:12 a.m. and 3:28 a.m. on Oct. 1 to clear insurgents in their path.

The forces managed to seize the headquarters of a paramilitary police force, and they took the city’s prison. The Americans reached the provincial police headquarters around 4 a.m.

On their way into the compound, they hit a trip wire that set off a roadside bomb and were then attacked by a Taliban suicide car bomber. But no one was injured by the bombs, and a lull in the fighting ensued, giving them time to take up defensive positions.

Continue reading the main story

Continue reading the main story

American Special Forces Fight to Retake an Afghan City

OCT. 1 TO 3

American Special Forces took up positions at the Afghan provincial police headquarters, where they battled Taliban attacks.

Intended airstrike target

OCT. 3

A hospital run by Doctors Without Borders was hit by an American airstrike early in the morning.

KUNDUZ

SEPT. 30 TO OCT. 1

Supported by five airstrikes, American and Afghan forces pushed into the city along the eastern edge in the face of heavy Taliban resistance.

Kunduz

AFGHANISTAN

SEPT. 29 TO 30

American forces battled through the night to secure Kunduz airport, south of the city.

1 MILE

About an hour later, the Taliban launched an assault on the compound. The fighting was intense and went on throughout the day and into the next. At one point, a rocket-propelled grenade fired from close range nearly breached one of the Hesco barriers, hulking bales of canvas wrapped in wire mesh and filled with dirt, that lined the compound’s perimeter.

“It was readily apparent that there was a level of sophistication and coordination that none of us had ever come up against,” said the Green Beret who complained about the lack of guidance.

The Airstrike

By nightfall on Oct. 1, Afghan reinforcements finally arrived with supplies — ammunition, food and water — and the promise of relief for the Americans. The Afghans also said they would abandon the compound if the Americans pulled back to the airport as planned. So the Green Berets stayed, waiting on a larger group of Afghan reinforcements that never arrived.

The next afternoon had the heaviest fighting yet. Buildings around the compound were “nearly obscured by the smoke and dust from the exchange of fire,” another Green Beret said.

Three Afghan soldiers were injured, and Afghan troops began organizing a convoy to evacuate the wounded to the airport and bring back more supplies.

The Afghans also came up with a plan to seize what was believed to be the Taliban’s command center: the local headquarters of Afghanistan’s spy agency, the National Directorate of Security. It was only about 500 meters from the police compound, and the Afghan troops would move against the N.D.S. headquarters on their way back from the airport. The Americans agreed to coordinate air support if needed.

The major told investigators that he had not been concerned about civilians being hit. The N.D.S., with a documented history of torture, is feared by most Afghans. “Nobody squats in an N.D.S. facility,” the major told investigators.

In the early hours of Oct. 3, the major was at his command post — a Humvee with a map laid across the hood — awaiting word from the Afghan force he believed was headed toward the N.D.S. building.

By then, the major had experienced “significant fighting for approximately 51 hours,” the report said. He had hardly slept.

Today’s Headlines: Asia Edition

Get news and analysis from Asia and around the world delivered to your inbox every day in the Asian morning.

After a confusing back-and-forth with Afghan officers, he came to believe that the Afghan commandos were under fire from the N.D.S. building. (They were in fact nowhere near it.) The major called in air support from an AC-130 gunship.

He then climbed to a balcony in one of the police compound’s buildings, seeking a better vantage. He could hear intermittent gunfire. But he could not see much.

The gunship was also struggling to find the building. It had the right coordinates, but its targeting system malfunctioned. It pointed the aircraft to an empty field. The crew members, however, spotted a building nearby that they and the Green Berets on the ground concluded was the N.D.S. building.

It was not. They were looking at the Doctors Without Borders hospital, and they missed what should have been obvious signs. None of the people spotted inside the compound appeared to be armed.

At 2:08 a.m. on Oct. 3, the gunship opened fire. The first round hit a courtyard where nine unarmed people were milling about.

The attack continued until 2:38 a.m., the investigators found, and the gunship fired 211 rounds, killing 42 people. Military investigators would describe the attack as a violation of the laws of armed conflict and “a disproportional response to a threat that did not exist.”

But in the immediate aftermath, the Green Berets thought they had hit the right target. Fighting fell off sharply in the morning, and the Taliban began retreating. The Green Berets heard reports of civilians killed in the city but did not connect the casualties to the strike.

It was only on Oct. 5, when the Green Berets returned to Bagram Air Field, the main American base in Afghanistan, that they found out the gunship had hit a functioning hospital, not a Taliban command post.

“We saw the news in the chow hall,” said the soldier who complained about a lack of guidance from commanders. “The whole detachment was in disbelief.”

That day in Washington, General Campbell briefed reporters about the accidental strike on the hospital, saying the facts would be established by military investigators.

But General Campbell was unequivocal on one point. “Our personnel are not directly engaged in the fighting,” he said.