It comes as American forces are set to complete their withdrawal from the country in the coming weeks, marking a decisive period for Afghanistan.
General Mark Milley, chairman of the Joint Chiefs of Staff, said in a Pentagon press conference: "This is going to be a test now of the will and leadership of the Afghan people – the Afghan security forces and the government of Afghanistan."
The Pentagon says the US withdrawal is 95% finished and will be completed by 31 August.
A small number of British military personnel will temporarily remain in Afghanistan to support the transition to a new phase of UK support for the country, the Ministry of Defence (MOD) said.
Watch: Soldiers from 3 SCOTS recently took part in a flag-lowering ceremony in Afghanistan.
The Biden administration has vowed to continue financial assistance and logistical support for Afghan forces after 31 August, but US Defense Secretary Lloyd Austin said the focus of US military efforts there will be countering terrorist threats, not the Taliban.
Speaking alongside Gen Milley, Mr Austin said the US will "keep an eye on" al-Qaeda, the extremist network whose use of Afghanistan as a haven for planning the 9/11 attacks on the United States was the reason US forces invaded Afghanistan in 2001.
"Our major focus going forward is to make sure that violence, terrorism, cannot be exported from Afghanistan to our homeland, and so we'll maintain the capability to be able to not only observe that but also address that if it does emerge," Mr Austin said.
He added that the Taliban pledged in 2020 to not provide a sanctuary for al-Qaeda in the future.
"We expect for them to meet that commitment.
"If they want legitimacy going forward, I think that's something they'll have to consider.
"That's one way to earn it, so we'll see what happens."
Watch: Timeline of British forces in Afghanistan.
He reiterated his view that there is a "medium risk" of al-Qaeda regaining, within about two years of the US departure, the capability to launch attacks against the West.
"But, again, there are a number of things that could happen to speed that up a bit or slow it down," he added.
Gen Milley said the Taliban now control about half of the 419 district centres in Afghanistan, and while they have yet to capture any of the country's 34 provincial capitals, they are pressuring about half of them.
As the Taliban seize more territory, the Afghan security forces are consolidating their positions to protect key population centres, including Kabul, he said.
"A significant amount of territory has been seized over the course of six, eight, 10 months by the Taliban, so momentum appears to be, strategic momentum appears to be, sort of with the Taliban," Gen Milley said.
Gen Milley said that while the Taliban are attempting to create the impression that their victory over the US-backed Kabul government is inevitable, he believes the Afghan military and police have the training and equipment to prevail.
He said he would not rule out a negotiated political settlement with the Taliban, nor would he exclude "a complete Taliban takeover".
"I don't think the end game is yet written," he said.