Image copyright AP

The US commander of international forces in Afghanistan has said an air strike on a hospital in the northern city of Kunduz was a mistake.

Gen John Campbell said that the US would never intentionally target a protected medical facility.

At least 22 people were killed in the attack as government forces battled to retake the city from the Taliban.

Gen Campbell also said that the US must consider boosting its military presence in Afghanistan after 2016.

He said that such a measure would be necessary if the Taliban upsurge was to be repelled and Afghanistan's military kept up to fighting strength.

The "tenuous security situation" might require a re-think of any troop drawdown, the general said.

Analysis: Nick Bryant, BBC News, Washington DC

To begin with the language was guarded, as one would expect from an officer mindful of the chain of command, but the message delivered on Capitol Hill by America's top military commander in Afghanistan soon became abundantly clear: the Obama administration should rethink its plan to reduce the number of US troops in the country from the present level of 9,800 to 1,000 by the end of next year.

"Yes sir," said Gen John F Campbell, when asked whether his commander-in-chief, President Obama, should review the drawdown plan.

Restricting the American presence to a security force based at the US embassy in Kabul would mean that the ability to train, advise and assist Afghan forces would be "very limited", he said.

As for counter-terrorism operations, they also would be "much more limited".

Alternative recommendations had been presented to the White House, although Gen Campbell would not provide specifics. But the options were "above and beyond a normal embassy presence".

What he was essentially saying was that the US military cannot abandon Afghanistan, given the resurgence of the Taliban and the inability of Afghan forces to fight the insurgents by themselves.

Medical charity MSF has called for an independent international inquiry into the Kunduz attack.

It has launched a Twitter campaign in support of its demand.

The charity said that statements from the Afghan government implied that the hospital had been deliberately targeted - and amounted to an admission of a war crime.

Image copyright EPA Image caption Gen Campbell is concerned that the Afghan military is kept up to strength to fend off the Taliban

Image copyright AP Image caption The hospital was severely damaged and is no longer being used by MSF

In testimony before the Senate Armed Services Committee in Washington, Gen Campbell said: "To be clear, the decision to provide aerial fires was a US decision, made within the US chain of command."

Gen Campbell said that the proposed air strike underwent "rigorous" US military procedures beforehand which were intended to prevent such mistakes.

He said the attack was requested by Afghan forces who were in communication with American special operations troops at the scene.

Those US forces in turn were in contact with the AC-130 gunship that fired on the hospital, he said.

"The hospital was mistakenly struck," he said. "We would never intentionally target a protected medical facility."

Differing US statements on hospital strike

Saturday - Col Brian Tribus, spokesman for US Forces in Afghan

US forces conducted an airstrike in Kunduz city at 2:15am (local), Oct 3, against individuals threatening the force. The strike may have resulted in collateral damage to a nearby medical facility. This incident is under investigation.

Sunday - Pentagon press office

US forces conducted an airstrike in Kunduz city at 2:15am (local), Oct 3, against insurgents who were directly firing upon US service members advising and assisting Afghan Security Forces in the city of Kunduz. The strike was conducted in the vicinity of a Doctors Without Borders medical facility.

Monday - Gen John Campbell, US military chief in Afghanistan

We have now learned that on October 3, Afghan forces advised that they were taking fire from enemy positions and asked for air support from US forces. An airstrike was then called to eliminate the Taliban threat and several civilians were accidentally struck. This is different from the initial reports, which indicated that US forces were threatened and that the airstrike was called on their behalf.

Tuesday - Gen John Campbell to the Senate committee

On Saturday morning our forces provided close air support to Afghan forces at their request. To be clear the decision to provide aerial fires was a US decision, made within the US chain of command. A hospital was mistakenly struck. We would never intentionally target a protected medical facility… I assure you that the investigation will be thorough, objective and transparent.

The general said that he was not in a position to provide more details about what happened, including who may have failed to follow military guidelines to avert attacks on hospitals.

He said that such details must await the outcome of numerous inquiries.

The White House on Tuesday announced that Department of Justice would investigate the air strike.

Similar probes are being conducted by the Pentagon, Nato and an American-Afghan team.

Media playback is unsupported on your device Media caption 'I saw doctors and patients burning' - survivors of the attack spoke to the BBC's Shaimaa Khalil

MSF President Joanne Liu has dismissed the American explanation for the attack. "Until proven otherwise, we are working on the presumption of a war crime," she said in a statement.

She said that her charity had alerted the Afghan and coalition military leadership about the attack, which continued for at least another 30 minutes.

"The hospital was well known and the GPS co-ordinates had been regularly shared with coalition and Afghan military and civilian officials, as recently as Tuesday 29 September," she said.

"This attack cannot be brushed aside as a mere mistake or an inevitable consequence of war."

Read more on the battle for Kunduz: