An airstrike, probably carried out by U.S.-led coalition forces, killed 19 staff and patients on Saturday, including three children, in a hospital run by Medecins Sans Frontieres (MSF) in the northern Afghan city of Kunduz, the aid group said.

The U.S. military said it conducted an air strike "in the vicinity" of the hospital as it targeted Taliban insurgents who were directly firing on U.S. military personnel. It said an investigation had begun, while the White House said in a statement that it expects "a full accounting of the facts and circumstances" of the incident.

U.N. Human Rights chief Zeid Ra'ad Al Hussein led a chorus of condemnation, without saying who carried out the strike, noting that an assault on a hospital could amount to a war crime. "This event is utterly tragic, inexcusable, and possibly even criminal," he said.

U.N. Secretary-General Ban Ki-moon called for a thorough and impartial investigation "in order to ensure accountability."

The medical charity said its staff phoned military officials at NATO in Kabul and Washington during the morning attack, but bombs continued to rain down for nearly an hour.

"All indications currently point to the bombing being carried out by international Coalition forces," MSF said, demanding "a full and transparent account".

Medical charity MSF said it had given the location of the hospital to both Afghan and U.S. forces several times in the past few months, most recently this week, to avoid being caught in crossfire.
At least three children, four adult patients and 12 MSF personnel died in the blasts, the aid group said. At least 37 people were wounded and many are still missing, it said.

"On behalf of the American people, I extend my deepest condolences to the medical professionals and other civilians killed and injured in the tragic incident at a Doctors Without Borders hospital in Kunduz," U.S. President Barack Obama said in the White House statement.

The Afghan Ministry of Defence said in a statement that Taliban fighters had attacked the hospital and were using the building "as a human shield." It said during the firefight, a rocket landed close to the hospital, wounding civilians.

At the charred remains of aid group's facility, one wall of a building had collapsed, scattering fragments of glass and wooden door frames, and three rooms were ablaze, Saad Mukhtar, director of public health in Kunduz, said.

"Thick black smoke could be seen rising from some of the rooms," he said after a visit to the hospital. "The fighting is still going on, so we had to leave."

Afghan government forces backed by U.S. air power have fought to drive the Taliban out of the northern provincial capital since the militants seized it six days ago, in the biggest victory of their near 14-year insurgency.

The battle in Kunduz comes just as the United States is weighing whether to slow a drawdown of the nearly 10,000 U.S. forces in Afghanistan. The top U.S. commander in Afghanistan, Army General John Campbell, has drawn up options that include keeping thousands of troops in the country beyond 2016, U.S. officials say.

HUGE EXPLOSIONS

Resident Khodaidad told Reuters the Taliban had been using the hospital buildings for cover during fighting on Friday.

"I could hear sounds of heavy gunfire, explosions and airplanes throughout the night," he said.

"There were several huge explosions and it sounded like the roof was falling on me."

A U.S. official, speaking on condition of anonymity, said a U.S. military AC-130 gunship had been operating in the area, firing at Taliban targets to provide what was essentially defensive, close-air support to ground forces.

The AC-130 fires at low altitude using line-of-sight to direct munitions. But it was still unclear whether rounds from the AC-130 struck the hospital, the official said, noting that coalition forces have dispatched a one-star general from Kabul to investigate the incident.

"The bombs hit and then we heard the plane circle round," said Heman Nagarathnam, MSF head of programs in northern Afghanistan, in a statement. "There was a pause and then more bombs hit ... When I made it out from the office, the main hospital building was engulfed in flames."

The hospital had treated almost 400 patients in the 150-bed hospital since fighting broke out on Monday, most for gunshot wounds. So many patients have flooded in that the hospital had to put them in offices and on mattresses on the floor.

Afghan President Ashraf Ghani's spokesman said last week there would be no air strikes inside the city because of the risk of mass civilian casualties.

Ghani's predecessor, Hamid Karzai, fell out with his backers in Washington in part over the number of civilians killed by bombs in the nearly 14-year-old war, America's longest military conflict.