The US has said it will continue to carry out air strikes to support Afghan government forces facing attack from the insurgent Taliban, as other international forces have drawn down troops.
The Taliban have escalated their offensive in Afghanistan in recent weeks, taking rural districts and surrounding provincial capitals.
"The United States has increased air strikes in support of Afghan forces over the last several days and we're prepared to continue this heightened level of support in the coming weeks if the Taliban continue their attacks," US General Kenneth McKenzie said in Kabul on Sunday.
President Joe Biden said in April US troops would be withdrawn by September, ending a 20-year foreign military presence.
Gen McKenzie, who leads US Central Command, which controls US forces for a region that includes Afghanistan, declined to say whether Washington would continue air strikes after the end of the military mission on August 31.
"The government of Afghanistan faces a stern test in the days ahead ... The Taliban are attempting to create a sense of inevitability about their campaign," he said.
But he said a Taliban victory was not inevitable and a political solution remained a possibility.
Afghan government representatives and Taliban negotiators have met in Qatar's capital, Doha, in recent weeks, although diplomats say there have been few signs of progress since peace talks began in September.
Reeling from battlefield losses, Afghanistan's military is overhauling its war strategy against the Taliban to concentrate forces around the most critical areas like Kabul and other cities, border crossings and vital infrastructure, Afghan and US officials have said.
US Defence Secretary Lloyd Austin said on Saturday that the Afghan security forces' first job was to make sure they could slow the Taliban's momentum before attempting to retake territory.
Gen McKenzie said there would likely be a rise in violence after a lull over a Muslim holiday this week and said the Taliban could focus on populated urban centres.
"They are going to have to deal with the cities if they want to try and claw their way back into power" he said. "I don't think it's a foregone conclusion that they are going to be able to capture these urban areas."
US airpower has long provided Afghan forces with a tactical advantage against the Taliban – one that many fear will be eroded by the withdrawal of international troops, though Afghanistan's own fledgling air force is flying into the breach.
Gen McKenzie said it will be clear in the next "days and weeks" if the Afghan government will be able to defend the country from the Taliban.
"I don't think it's going to be an easy path .. (but) I do not accept the narrative that there is going to be a civil war of necessity," he said.
Gen McKenzie's remarks came as about 22,000 families were displaced by the fighting in the past month in the southern city of Kandahar itself.
"They have all moved from the volatile districts of the city to safer areas," Dost Mohammad Daryab, head of the provincial refugee department, told AFP.
On Sunday, fighting continued on the outskirts of Kandahar city, a southern government stronghold which is now all but surrounded.
Kandahar resident Hafiz Mohammad Akbar said his house had been taken over by the Taliban after he fled.
"They forced us to leave... I am now living with my 20-member family in a compound with no toilet," said Mr Akbar.
Residents expressed concerns the fighting might increase in days ahead.
"If they really want to fight, they should go to a desert and fight, not destroy the city," said Khan Mohammad, who moved to a camp with his family.
"Even if they win, they can't rule a ghost town."
Kandahar, with its 650,000 inhabitants, is the second-largest city in Afghanistan after Kabul.