NATO and US forces knew the precise location of the Médecins Sans Frontières hospital in Afghanistan for over a month before it was bombed in the early hours of yesterday morning, killing at least 19 doctors and patients.

The UN High Commissioner for Human Rights has suggested that the attack on the hospital in Kunduz, which should be protected in conflict under the Geneva Convention, may be a war crime, labelling it “inexcusable and possibly even criminal”.

Médecins Sans Frontières (Doctors Without Borders), which lost 12 doctors in the attack, has labelled the bombing a “grave violation of international law”. Some patients burned to death in their hospital beds.

The charity said that it had clearly informed representatives in Kabul and Washington of the GPS coordinates of its hospital just outside the besieged city of Kunduz on multiple occasions in the past month, most recently on September 29 - just five days before the attack.

MSF also claimed the sustained aerial bombing continued for 30 minutes after the charity made frantic phone calls to US and Afghan officials, informing them that the hospital was being hit.

Twelve doctors and seven patients - including three children - were killed and at least 37 wounded in the incident, several of whom are in a critical condition. MSF said others were unaccounted for and it is expected that the death toll may rise.

At the time of the bombing, 105 patients and their carers, and more than 80 MSF international and national staff were in the hospital.

“This attack is abhorrent and a grave violation of international humanitarian law,” said Meinie Nicolai, MSF president. “We demand total transparency from coalition forces. We cannot accept that this horrific loss of life will simply be dismissed as ‘collateral damage’.”

“The bombs hit and then we heard the plane circle round,” said Heman Nagarathnam, MSF 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.”

US forces and NATO confirmed that the attack had taken place, claiming that it was a counter attack on Taliban fighters which may have caused “collateral damage” and said they were investigating how the hospital came to be hit.

The US secretary of defence, Ash Carter, said: “While we are still trying to determine exactly what happened, I want to extend my thoughts and prayers to everyone affected. A full investigation into the tragic incident is underway in coordination with the Afghan government.”

UN High Commissioner for Human Rights Zeid Ra'ad Al Hussein said: "This event is utterly tragic, inexcusable, and possibly even criminal. The seriousness of the incident is underlined by the fact that, if established as deliberate in a court of law, an airstrike on a hospital may amount to a war crime."

Patricia Gossman, senior researcher at Human Rights Watch, said: “The failure of US forces to stop an attack striking a hospital strongly suggests the forces may have violated the laws of war.”

Amnesty International’s Afghanistan researcher Horia Mosadiq added: “It is sickening to think that doctors and other staff have had to pay with their lives while trying to save others. Hospitals are places of sanctity under international law governing conflict.”

Images and video posted by hospital staff yesterday showed blackened buildings, some still on fire, with rubble, broken glass and upturned stretchers surrounding them. Residents said the smell of charred bodies filled the air.

The Afghani Government claimed that the attack had been launched in response to reports that 10-15 terrorists had been hiding in the hospital complex and were firing at security forces from inside the MSF compound at the time of the attack.

MSF said: “We have absolutely no information about that."

Humza Yousaf, Scottish Government Minister for External Affairs, said: "There must now be an investigation into this airstrike and how such an appalling tragedy was allowed to happen.”

Intense fighting has been going on in Kunduz since Monday when Taliban fighters, who are active in surrounding provinces, attempted to take the city.

On Thursday the Afghan army said they had reclaimed the city though the Taliban has said it has withdrawn strategically and fighting has continued.

MFS has treated 394 people in the hospital, the only one of its kind in the north-eastern region of the country, since the fighting broke out.