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.
The Taliban have seized districts in the city centre.
But Gen Sadat said he was confident the group would not take the city.
He told the BBC that while ground had been lost, 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 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. It is one of three provincial capitals under attack.
Attempts by the militants to capture Kandahar, Afghanistan’s second-largest city, have continued after rocket strikes hit its airport on Sunday.
Seizing control of Kandahar would be a huge victory for the Taliban, giving them a grip on the south of the country.
In a third besieged city, Herat, in the west, government commandos are battling the insurgents after days of fierce fighting. Government forces have taken back some areas after a UN compound was attacked on Friday.
Videos shared on social media appeared to show residents on the streets and rooftops of Herat shouting “Allahu akbar” (“God is greatest”) in support of the government’s gains.
As government forces struggled to contain Taliban advances, President Ashraf Ghani blamed the sudden withdrawal of US troops for the increase in fighting.
“The reason for our current situation is that the decision was taken abruptly,” he told parliament.
Mr Ghani said he had warned Washington that the withdrawal would have “consequences”.
Although nearly all its military forces have left, the US has continued its air offensive in support of government troops. Strikes targeting Lashkar Gah continued late on Monday.
President Biden’s administration announced on Monday that because of the increase in violence, it would take in thousands more Afghan refugees who worked with US forces.
The US and UK have accused the Taliban of committing possible war crimes by “massacring civilians” in a town captured near the Pakistan border.
US Secretary of State Antony Blinken said he had seen reports of “deeply disturbing” Taliban atrocities.
Gruesome videos that emerged from Spin Boldak apparently showed revenge killings. The Taliban have rejected the accusations.