Afghanistan's acting defense minister said on Monday that the Doctors Without Borders hospital in the north of the country that was bombed by U.S. forces was being used by insurgents who were fighting government forces.

Masoom Stanekzai told The Associated Press in an interview that Taliban insurgents and possibly Pakistani intelligence operatives were using the facility in Kunduz city as a "safe place."

The hospital was bombed by a U.S. AC-130 gunship in the early hours of Oct. 3, killing at least 22 people and injuring many more. The main building was destroyed and the hospital has been shut down.

"That was a place they wanted to use as a safe place because everybody knows that our security forces and international security forces were very careful not to do anything with a hospital," Stanekzai said. "But when there was on one of the walls of the hospital, there was a Taliban flag -- what can you think?"

The group, also known by its French acronym MSF, has repeatedly denied the presence of Taliban fighters in the hospital compound at the time of the attack.

Kate Stegeman, MSF's communications director in Afghanistan said on Monday: "We reiterate that every staff member in Kunduz working for MSF has repeatedly reported to us that there were no armed people in the hospital at the time of the bombing."

Doctors without Borders has acknowledged that it treated wounded Taliban fighters at the Kunduz hospital, but it insists no weapons were allowed in. Afghans who worked at the hospital have told the AP that no one was firing from within.

But Stanekzai insisted that a Taliban flag had been hoisted on the walls around the hospital compound and that the militants were using it as a base.

"I am saying the compound was being used by people who were fighting there, whether it was Taliban or ISI or whoever they were," he said, referring to Pakistan's powerful Inter-Services Intelligence agency, long accused by Kabul of supporting the Taliban. "If the fighting was not coming from there, that kind of a mistake will never happen."

Taliban fighters took control of Kunduz on Sept. 28 in a multi-pronged surprise attack. What followed was a three-day looting and killing spree that ended when government forces launched a counter offensive on Oct. 1.

The hospital was bombed repeatedly just after 2 a.m. on Oct. 3. President Barack Obama apologized for the bombing and the commander of U.S. and NATO forces in Afghanistan, Gen. John F. Campbell said it was a mistake. He said the airstrike had been called in by Afghan forces.

According to AP reporting, American special operations analysts were scrutinizing the Afghan hospital days before it was destroyed because they believed it was being used by a Pakistani operative to coordinate Taliban activity. The analysts knew it was a medical facility, according to a former intelligence official who is familiar with some of the documents describing the site.

It's unclear whether that information ever got to commanders who unleashed the AC-130 gunship on the hospital.

Details of the incident are being investigated by the U.S. military, NATO and by the Afghan government as part of its probe into how the Taliban were able to take over the provincial capital, the first major urban center they've taken since a U.S. invasion toppled their regime and the insurgency began in 2001. Preliminary details of the NATO investigation are expected in the coming days.

The special operations analysts had assembled a dossier that included maps with the hospital circled, along with indications that intelligence agencies were tracking the location of the Pakistani operative and activity reports based on overhead surveillance, according to a former intelligence official who is familiar with some of the documents describing the site. The intelligence suggested the hospital was being used as a Taliban command and control center and may have housed heavy weapons.

After the attack, some U.S. analysts assessed that the strike had been justified, the former officer says. They concluded that the Pakistani, believed to have been working for the ISI intelligence agency, had been killed.

No evidence has surfaced publicly suggesting a Pakistani died in the attack, and Doctors without Borders, the international organization that ran the hospital, says none its staff was Pakistani. The former intelligence official was not authorized to comment publicly and spoke only on condition of anonymity.

The new details about the military's suspicions that the hospital was being misused complicate an already murky picture and add to the unanswered questions about one of the worst civilian casualty incidents of the Afghan war. They also raise the possibility of a breakdown in intelligence sharing and communication across the military chain of command.

MSF, a Nobel Peace Prize-winning organization that provides medical aid in conflict zones, has called for an investigation by the International Humanitarian Fact-Finding Commission, based in the Swiss capital, Bern. It is made up of diplomats, legal experts, doctors and some former military officials from nine European countries, including Britain and Russia. An IHFFC investigation needs the cooperation of both Afghanistan and the U.S. before it can proceed, which neither government is expected to give.

Stankezai said Afghanistan will not support the sort of investigation that MSF has demanded. "If you increase the number of commissions and investigating teams, that will make it more complicated instead of getting into the facts. Already there are three investigations; how many more do you need?"

Stanekzai said his government had evidence the insurgents were communicating with command and control centers in Pakistan. "We have traced very clearly the communications they were receiving from Quetta, Peshawar and Karachi," he said, naming three Pakistani cities where the Afghan Taliban presence is widely known.

"That also means that there are bases there from where they are making those calls and long-range radio communications. That is quite frankly, clear, that communication did exist," he said.

"How can any country allow the nationals of other countries to have such large-scale operations from their soil and just sit and watch them," Stanekzai said.

The Afghan government has in recent months openly accused Pakistan of supporting the Taliban's war against Kabul. After an attempt at diplomatic detente to end the war, President Ashraf Ghani's government announced that Taliban leader Mullah Mohammad Omar had been dead for more than two years -- precipitating an internal Taliban power struggle and the cancellation of peace talks.

The Taliban named Mullah Akhtar Mansoor, Mullah Omar's former deputy who is believed to have ISI backing, as their new leader. The Kunduz operation is seen as Mansoor's  attempt to consolidate power and convince detractors that he can take the fight to the battlefield and draw other insurgent groups to join him. His deputies are senior members of the well-funded Haqaani network terrorist group, and he has publicly declared a partnership with al-Qaeda.

Stanekzai and other Afghan leaders have said the Taliban in Kunduz were joined other insurgent groups, including the Islamic Movement of Uzbekistan -- which has its sights on Central Asia.