KABUL, Afghanistan — The Doctors Without Borders hospital was among the most brightly lit buildings in Kunduz on the night a circling American gunship destroyed it.

The rest of the northern Afghan city was mostly dark after days of fighting between the security forces and Taliban militants. But the hospital was keeping its lights on as doctors there were working, according to the group’s general director, Christopher Stokes.

Spread across the hospital roof was a large white and red flag reading “Médecins Sans Frontières,” the group’s French name. On the afternoon before the strike, the fighting in the neighborhood had quieted enough for staff members to safely climb to the roof and lay out the markers identifying the building to any military aircraft flying over.

The group had also sent the longitude and latitude coordinates of the hospital, for years the most important trauma center in that part of northern Afghanistan, to the United States military to remind it where not to attack during the fighting.