General Sami Sadat is leading the battle against the Taliban in the southern province of Helmand, where intense fighting has broken out in its capital Lashkar Gah.
At least 40 civilians have been killed there in the past day, the UN says.
The Taliban are reported to have captured most of the city.
However, the fighting is continuing and government forces have vowed not to let Lashkar Gah fall into militant hands.
Gen Sadat told the BBC that while government forces had lost ground, he believed the Taliban would be unable to sustain their assault.
However, he said the Taliban were being reinforced by fighters from other Islamist groups and warned that their gains posed a threat beyond Afghanistan.
"This will increase the hope for small extremist groups to mobilise in the cities of Europe and America, and will have a devastating effect on global security," he said.
"This is not a war of Afghanistan, this is a war between liberty and totalitarianism."
The Taliban assault in Helmand province is part of a major offensive across Afghanistan.
The militants have made rapid advances in recent months as US forces have withdrawn after 20 years of military operations in the country.
Helmand was the centrepiece of the US and British military campaign, and any Taliban gains there would be a blow for the Afghan government.
If Lashkar Gah fell, it would be the first provincial capital won by the Taliban since 2016, when they briefly held the northern city of Kunduz.
'Corpses on the roads'
Residents of Lashkar Gah say they are living in fear as the city faces heavy assault from the militants, who are being targeted with US and Afghan air strikes.
"Neither the Taliban will have mercy on us nor will the government stop the bombing. There are corpses on the roads. We do not know if they are civilians or the Taliban," one resident told the BBC.
Another said: "I do not know where to go, there are clashes in every corner of the city."
The United Nations Assistance Mission in Afghanistan (Unama) says civilians are "bearing the brunt" of the fighting, with the Taliban ground offensive and Afghan air strikes causing the most harm.
It has called on both sides to do more to protect civilians, including an immediate end to fighting in urban areas.
In addition to the fatalities, dozens of people have been injured and thousands displaced, according to Unama.
Doctors in Lashkar Gah have reported being overwhelmed and running low on supplies. "There is fighting all around," one told the BBC.