US President Barack Obama has pledged a full investigation into an apparent US air strike on an Afghan hospital that killed 19 people, in a bombing the UN said could amount to a war crime.
Doctors Without Borders (MSF) said patients burned to death in their beds during a bombing raid that continued for half an hour after US and Afghan authorities were informed the hospital had been hit.
"Twelve staff members and at least seven patients, including three children, were killed; 37 people were injured," the charity said. "This attack constitutes a grave violation of international humanitarian law."
The air raid came days after Taliban fighters seized control of the strategic northern city of Kunduz, in their most spectacular victory since being booted from power by a US-led coalition in 2001.
Afghan forces, backed up by their NATO allies, claimed to have wrestled back control of the city.
But the defence ministry in Kabul said, "A group of armed terrorists ... were using the hospital building as a position to target Afghan forces and civilians."
MSF has denied any fighters were present in the hospital.
The charity said despite frantic calls to American and Afghan military officials in Kabul and Washington, the attack continued for another 30 minutes, with the main hospital building housing the intensive care unit and emergency rooms being targeted.
"The bombs hit and then we heard the plane circle around," said Heman Nagarathnam, MSF's head of programmes in northern Afghanistan.
"There was a pause, and then more bombs hit. This happened again and again. When I made it out from the office, the main hospital building was engulfed in flames.
"Those people that could had moved quickly to the building's two bunkers to seek safety. But patients who were unable to escape burned to death as they lay in their beds."
In a statement released by the White House, Obama offered his "deepest condolences" for what he called a "tragic incident".
"The Department of Defense has launched a full investigation, and we will await the results of that inquiry before making a definitive judgement as to the circumstances of this tragedy," Obama said.
NATO earlier conceded US forces may have been behind the bombing after forces had launched a strike they said was intended to target fighters.
"The strike may have resulted in collateral damage to a nearby medical facility. This incident is under investigation," a NATO statement said.
UN says Afghan hospital bombing may be war crime
The incident has renewed concerns about the use of US air strikes in Afghanistan, a deeply contentious issue in the 14-year campaign against Taliban fighters.
UN rights chief Zeid Ra'ad Al Hussein called for a full and transparent probe, noting: "An air strike on a hospital may amount to a war crime."
"This event is utterly tragic, inexcusable and possibly even criminal," he said.
MSF said some 105 patients and their caregivers, as well as more than 80 international and local MSF staff, were in the hospital, the only medical facility in the area that can deal with major injuries, at the time of the bombing.
The charity said Afghan and coalition forces were fully aware of the exact location of the hospital, having been given GPS co-ordinates of a facility it said had been providing care for four years.
"This attack is abhorrent and a grave violation of International Humanitarian Law," said MSF President Meinie Nicolai.
"We demand total transparency from coalition forces. We cannot accept that this horrific loss of life will simply be dismissed as 'collateral damage'."
Kunduz is facing a humanitarian crisis, with thousands of civilians caught in the crossfire between government forces and insurgents.
At least 60 people are known to have died and 400 wounded in recent fighting.