Former US Secretary of State Hillary Clinton has warned of "huge consequences" of President Joe Biden's decision to withdraw American troops from Afghanistan.
Mrs Clinton told CNN there was a risk the Taliban - the Islamist group ousted in 2001 by the US-led invasion - could retake control.
The US aims to complete the withdrawal by 11 September.
However, the Taliban have been carrying out more attacks.
"This is what we call a wicked problem," Mrs Clinton told CNN. "There are consequences both foreseen and unintended of staying and of leaving," she said.
Mrs Clinton, like Mr Biden a Democrat, was a strong supporter of the US intervention in Afghanistan after the 9/11 attacks in 2001.
Mr 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, Mrs 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.
She said the potential collapse of the Afghan government and a possible takeover by the Taliban could result in a new civil war.
Mrs Clinton 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.
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 400m (1312ft) 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.
A warning from the Washington establishment
Hillary Clinton represents the view of foreign-policy experts: The US should show its strength and deploy its military. Her criticism of Biden's plan reflects this sensibility.
Her criticism matters, in part because so many in the foreign-policy establishment, both Democrats and Republicans, agree with her. Condoleezza Rice, who served as secretary of state under President George W Bush, has also warned about the risks of withdrawing troops, and the threat of terrorism.
Yet liberals, such as Senator Bernie Sanders of Vermont, do not think the troops should be there. Nor do many Americans. A 2019 Gallup poll showed 58% of Democrats think the war in Afghanistan has made the US less safe from terrorism.
Clinton's views are important, but Biden has the support of many Americans. Plus, he's the president, and has made his decision. His views are the ones that matter now, not hers.
As vice-president to Barack Obama, Mr Biden frequently opposed a large US presence in Afghanistan.
He has said that the US will continue to support Afghan government forces - and encourage peace negotiations with the rebel Taliban leaders. However, correspondents say that may not be enough to ensure stability in the region.
Last year, then-President Donald Trump - who was keen for US troops to return home and criticised US military interventions for being costly and ineffective - set in motion a full US withdrawal from Afghanistan by 1 May this year.
The US then started withdrawing troops after the Taliban promised to stop carrying out attacks on international forces and "soft targets", and said it would not allow al-Qaeda or other militants to operate in areas it controls.
US military involvement in Afghanistan
October 2001: US-led bombing of Afghanistan begins following the 11 September attacks on the United States
February 2009: Nato countries pledge to increase military and other commitments in Afghanistan after US announces dispatch of 17,000 extra troops
December 2009: US President Barack Obama decides to boost US troop numbers in Afghanistan by 30,000, bringing total to 100,000. He says US will begin withdrawing its forces by 2011
October 2014: The US and UK end their combat operations in Afghanistan
March 2015: President Obama announces his country will delay its troop withdrawal from Afghanistan, following a request from President Ashraf Ghani
August 2017: US President Donald Trump says he's sending more troops to fight a resurgent Taliban
September 2019: Protracted peace talks between the Taliban and the US break down
February 2020: After months of on-off talks, the US signs a troop withdrawal agreement in Doha with the Taliban