Former US Secretary of State Hillary Clinton is warning of President Joe Biden's decision to withdraw American troops from Afghanistan will have "huge consequences".
There was a risk the Taliban - the Islamist group ousted in 2001 by the US-led invasion - could retake control, Clinton told CNN.
The US aimed to complete the withdrawal by 11 September.
However, the Taliban have been carrying out more attacks.
"This is what we call a wicked problem," Clinton told CNN. "There are consequences both foreseen and unintended of staying and of leaving," she said.
Clinton, like Biden a Democrat, was a strong supporter of the US intervention in Afghanistan after the 9/11 attacks in 2001.
Biden wants to complete the withdrawal by the 20th anniversary of the attacks later this year.
At least 2,500 US troops are currently deployed as part of the 9,600-strong Nato Afghan mission.
The president said the US pull-out was justified as American forces had ensured that the country could no longer be a base for foreign jihadists to plot against the West.
Asked about the president's decision by CNN's Fareed Zakaria on Sunday, Clinton said, "Our government has to focus on two huge consequences", notably the resumption of activities by extremist groups and a subsequent outpouring of refugees from Afghanistan.
The potential collapse of the Afghan government and a possible takeover by the Taliban could result in a new civil war, she said.
It was also important to protect the "many thousands of Afghans" who had worked with the US and Nato during the conflict, and said a large visa programme should be set up to provide for any refugees, Clinton said.
The remaining US troops in Afghanistan began formally withdrawing on 1 May, amid escalating violence.
Afghan security forces are on high alert for reprisal attacks.
On Monday, Afghan officials said at least seven soldiers had been killed in a Taliban attack on a military outpost in the south-western Farah province.
They said militants had blown up the post after digging a tunnel for about 400 metres to access it from a nearby house. One soldier had been captured by the insurgents, they said. Other reports put the Afghan army casualties much higher.
Speaking at a press conference in London on Monday, US Secretary of State Antony Blinken said the Biden administration was "very focused on a deliberate, safe and orderly" withdrawal of troops, but that the US would continue to assist the Afghan government.
"Even as our forces are pulling out of Afghanistan, we are not withdrawing - we are not disengaging," he said, adding that if US troops were attacked before leaving the country, "decisive action" would be taken.