The last US and Nato forces have left Afghanistan's Bagram airbase, the centre of the war against militants for some 20 years.
The pull-out could signal that the complete withdrawal of foreign forces from Afghanistan is imminent.
President Joe Biden has said US forces will be gone by 11 September.
But the withdrawal from the sprawling base, north of Kabul, comes as the main jihadist group, the Taliban, advances in many parts of Afghanistan.
The 11 September deadline is the anniversary of the attacks on America in 2001, which killed nearly 3,000 people.
The attacks were carried out by al-Qaeda, an international jihadist group then based in Afghanistan with the support of the Taliban, who had been in control of the country since the 1990s. A US-led coalition invaded Afghanistan later that year to defeat both groups.
America now wants to end its longest war with its huge cost in human lives and vast expense, and is leaving security to the Afghan government.
Some 2,500-3,500 US troops were thought to be still in Afghanistan until recently and when they depart, fewer than 1,000 American soldiers will remain. As of May there were about 7,000 other coalition troops in Afghanistan but it is believed that most have now left, with Germany and Italy declaring their missions over on Wednesday.
Meanwhile, a resurgent Taliban, buoyed by the expectation of the foreign withdrawal, has overrun dozens of districts, amid fears that a new civil war could erupt after the departure of foreign forces.
Presentational grey line
A top target for the Taliban
Analysis box by Lyse Doucet, chief international correspondent
Bagram is a bellwether of what's to come. This symbol of American military might was once a stronghold of Soviet forces. Now Afghan security forces will soon confront the challenge of securing this sprawling city within a city.
Bagram is vital - in symbolic and strategic ways. Taliban fighters, advancing in districts across the country, have this prize in their sights. Even last October, residents of the town which has swelled all around it told us the Taliban were already in their midst.
On a recent visit to the base, as the US packed up, we heard how Afghan security forces saw it as a mixed blessing. There's a wealth of military assets within its walls; but that treasure is a top target for Taliban, not to mention corrupt commanders and others eying this fortune.
For the countless Afghans whose lives and livelihoods have long banked on this base - and who now feel abandoned - Bagram's new chapter is deeply worrying.
Why is Bagram so important?
The airfield lies around 40km (25 miles) north of Kabul and is named after a nearby village.
Build-up around Bagram airbase
Drag button to see how base has grown
2003
It was built up by Moscow when the former Soviet Union occupied Afghanistan in the 1980s.
US-led coalition forces moved in during December 2001, and it was developed into a huge base capable of holding up to 10,000 troops.
It is served by two runways, the most recent of which is 3.6km long, where large cargo and bomber aircraft can land.
It has 110 parking spots for aircraft, which are protected by blast walls, and had a 50-bed hospital with a trauma bay, three operating theatres and a modern dental clinic, the Associated Press reports.
Its hangars and buildings included the main prison facility for people detained by US forces at the height of the conflict, which became known as Afghanistan's Guantanamo - after the infamous US military prison in Cuba.
Bagram was one of the sites identified in a US Senate report on the CIA's interrogation of al-Qaeda suspects, including the use of torture, carried out in detention facilities.
What happens next?
About 650 US troops are expected to remain in the country, the Associated Press reports, to provide protection for diplomats and help guard Kabul's international airport, a vital transport hub for the landlocked country.
They are guarding the airport alongside troops from America's Nato ally Turkey, while a new agreement for its security is negotiated with the Afghan government.
The airport's US protection includes a counter-rocket, artillery, mortar system and the troops to operate it, as well as helicopter support.
Other American troops will guard the US Embassy in Kabul.
Military analysts say the ability of the Afghan government to maintain control over Bagram will be vital to its efforts to defend Kabul and push back the Taliban.
"Henceforth the Afghan army forces will protect it and use it to combat terrorism," Afghan defence ministry spokesman Fawad Aman tweeted on Friday.
While the Taliban stopped attacks on coalition forces after signing an agreement with the US in February of last year, they have continued fighting government forces.
Every morning brings fresh reports of overnight fighting, the BBC's South Asia editor, Jill McGivering, says. Battles between the Taliban and government forces in Herat, Badakhshan, Baghlan and Paktia are all making news.
Some reports suggest June saw some of the worst violence since the arrival of the coalition, with hundreds of lives lost. And hard-won development is under threat too with many schools, government buildings and power pylons now damaged or destroyed.
A Taliban spokesman, Zabihullah Mujahid, welcomed the US withdrawal from Bagram, telling AFP news agency it would "pave the way for Afghans to decide about their future between themselves".
The war is thought to have taken the lives of more than 47,000 Afghan civilians and nearly 70,000 Afghan troops, as well as the lives of 2,442 US soldiers and more than 3,800 US private security contractors, and 1,144 soldiers from other coalition countries.
The Costs of War project at Brown University, which analyses America's wars this century, estimates that the war has cost America a total of $2.26tn (£1.64tn).