U.S. officials have launched an investigation after 12 local staff members of Doctors Without Borders and at least seven patients, three of them children, were killed after an explosion near their hospital in the northern Afghan city of Kunduz that may have been caused by a nearby airstrike.

In a statement, the international charity said the "sustained bombing" took place Saturday at 2:10 a.m local time. Afghan forces backed by U.S. airstrikes have been fighting to dislodge Taliban insurgents who overran Kunduz on Monday.

At least 37 other people were seriously injured--19 staff members and 18 patients and caretakers, the organization said. Dozens were missing, raising concerns the death toll could rise.

A senior defense official told Fox News on Saturday that the Taliban have been in control of the area around the hospital since Monday, guarding the building and drawing U.S. special operations forces into a firefight in the area. U.S. forces called in the airstrike because they were under fire and needed cover, the official said.

Taliban fighters were among those being treated at the hospital, a defense official told Fox News.

More On This...

While defense officials told Fox News they “regret the loss” of innocent life, they say the incident could have been avoided if the Taliban had not used the hospital as a base, and the civilians there as human shields.

A defense official also confirmed to Fox News Saturday that a 1-star U.S. military general has been dispatched from Kabul to Kunduz to investigate the bombing of the hospital.

President Obama said in a statement Saturday that he expected a full accounting of the circumstances surrounding the bombing, and that he would wait for those results before making a judgment. He said the U.S. would continue working with Afghanistan's government and its overseas partners to promote security in Afghanistan.

Defense Secretary Ash Carter called the bombing a "tragic incident."

"While we are still trying to determine exactly what happened, I want to extend my thoughts and prayers to everyone affected," he said in a statement. "A full investigation into the tragic incident is underway in coordination with the Afghan government."

U.S. forces in Afghanistan said they conducted an airstrike on Kunduz at 2:15 a.m. Saturday. The spokesman, U.S. Army Col. Brian Tribus, said the strike "may have resulted in collateral damage to a nearby medical facility" and that the incident was under investigation. Tribus said it was the 12th U.S. airstrike "in the Kunduz vicinity" since Tuesday.

Doctors Without Borders said its trauma center "was hit several times during sustained bombing and was very badly damaged." At the time of the bombing, the hospital had 105 patients and their caretakers, and more than 80 international and Afghan staff, it said.

'I heard the sound of the bomb and rushed to the hospital to get news. The operating theater was on fire, people were terrified, running everywhere'

- witness

"This attack is abhorrent and a grave violation of International Humanitarian Law," Doctors Without Borders president Meinie Nicolai said in a statement. "We demand total transparency from Coalition forces. We cannot accept that this horrific loss of life will simply be dismissed as 'collateral damage.'"

Interior Ministry spokesman Sediq Sediqqi said 10 to 15 "terrorists" had been hiding in the hospital at the time of the strike. "All of the terrorists were killed but we also lost doctors," he told a press conference. He said 80 staff at the hospital, including 15 foreigners, had been taken to safety.

Doctors Without Borders said all of its international staffers were alive and accounted for. It said it regularly updated its GPS coordinates with all parties to the conflict.

Adil Akbar, a doctor at the trauma center who was on duty at the time, told The Associated Press that the operating theater, emergency room and other parts of the hospital complex had been hit in the bombing.

"I managed to escape after the attack but I know that most of the staff and even some of the patients are missing," he said.

Zabihullah Pashtoonyar, a former local radio reporter who was working as a security guard at the compound, was one of those killed in the incident, said his relative Gul Rahim.

Wahidullah Mayar, spokesman for the Public Health Ministry, tweeted that 37 people were wounded, among them 24 medical and non-medical staff.

Bart Janssens, the charity's director of operations, said "we do not yet have the final casualty figures," adding that the group's medical team was treating wounded patients and staffers.

Nicholas Haysom, the U.N. special representative in Afghanistan, condemned the "tragic and devastating airstrike" on the hospital. "I reiterate my call on all parties to the conflict to respect and protect medical and humanitarian personnel and facilities," he said in a statement.

The International Committee of the Red Cross, which also has facilities in Kunduz, said it was "deeply shocked."

Doctors Without Borders said it had treated 394 people wounded in fighting since the Taliban attacked the city. Afghan forces went in on Thursday, and the fighting has been underway since then. At the time of the airstrike there were 105 patients and their caretakers in the hospital, alongside more than 80 Doctors Without Borders staffers.

Sediqqi said Afghan forces were still sweeping the city for militants, conducting "meter to meter, house to house operations" that would continue until "all those bad elements" had been eliminated.

Taliban spokesman Zabihullah Mujahid issued a statement saying there were no Taliban fighters in the hospital at the time of the bombing. It accused Afghanistan's intelligence service of misdirecting the airstrike to purposefully hit the hospital.

The clinic in Kunduz is a sprawling facility with numerous buildings situated in the east of the city, in a residential area close to the local office of the NDS intelligence service.

Another Kunduz resident, Dawood Khan, said a cousin who works at the clinic as a doctor was lightly wounded in the bombing.

"I heard the sound of the bomb and rushed to the hospital to get news. The operating theater was on fire, people were terrified, running everywhere," he said.

Electricity and water have been cut off since the Taliban's Monday assault and seizure of the city, officials and residents said. Food and medical supplies cannot get through because the Afghan military is still working to clear mines planted by the Taliban. Sporadic gunfights are continuing in various pockets of the city as troops advance.

Most of the Taliban appear to have fled the city after the troops moved in on Thursday, taking looted vehicles, weapons and ammunition with them.

Officials have reported that they have moved east, into Takhar and Badakhshan provinces, where a number of districts fell to the Taliban on Friday. The Defense Ministry said troops had retaken the Baharak district after retreating under fire Friday.

The U.S. Embassy in Kabul issued an emergency notice to Americans in Badakhshan, saying they should "consider departing the area immediately."

Fox News' Jennifer Griffin, Lucas Tomlinson, and The Associated Press contributed to this report.