Army Gen. John Campbell, commander of U.S. forces in Afghanistan, testifies before the Senate Armed Services Committee, Tuesday, Oct. 6, 2015. The committee questioned Campbell on the situation in Afghanistan and the U.S. airstrike on a hospital run by Doctors Without Borders that killed at least 22 people. Mark Wilson/Getty Images

Afghan forces still need U.S. assistance in fighting the Taliban, the commander of U.S. forces in Afghanistan told the Senate Armed Services Committee Tuesday. Gen. John Campbell faced tough questions from senators about the U.S. presence there just days after a U.S. airstrike hit a Doctors Without Borders hospital in the northern city of Kunduz.

The hospital airstrike killed 22 people Saturday, and Doctors Without Borders has called the incident a war crime. Senators asked Campbell several times Tuesday how the attack happened, and the general said Afghan forces had requested U.S. help because of the Taliban presence in Kunduz.

“The Taliban did go into Kunduz, they did know they were going to cause a fight in a built-up area,” Campbell said. "The hospital was mistakenly struck. We would never intentionally target a protected medical facility."

While Afghan forces were working hard and continuing their training, they still need to improve in some areas, including aviation, intelligence and special operations, Campbell said.

“Afghan security leaders need to discern better when to fight, when to hold and when to assume risk," Campbell told the committee.

Campbell said he has provided President Barack Obama with several policy options that could keep American troops in Afghanistan past 2016, when they are currently scheduled to leave, he said.

The chairman of the Armed Services Committee, Sen. John McCain, R-Ariz., has been urging Obama to reconsider the 2016 timeline, and many members of the committee pushed Campbell on this issue Tuesday.

Campbell said the situation has changed since Obama announced his withdrawal plan in 2014. The Taliban has emerged with new force and the Islamic State group has established a presence in Afghanistan as well. He added that President Mohammad Ashraf Ghani has asked multiple times for coalition forces to continue aiding his forces.

During the hearing, Campbell also said that while Ghani is trying to work with Pakistan to cut off supplies for various terrorist groups, Iran is providing money and weapons to the Taliban in western Afghanistan.