The last US and Nato forces have left Afghanistan’s Bagram airbase, the centre of the war against militants for some 20 years, US officials say.
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.
A top target for the Taliban
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.
At the White House on Friday, Mr Biden defended the withdrawal as “a rational drawdown with our allies, so there is nothing unusual about it”.
But as reporters pressed him, he told them: “I’m not going to answer any more questions about Afghanistan.”
Glancing down at his lectern, he said he wanted to celebrate the 4 July holiday weekend, adding that “all across America people are going to ball games and doing good things”, and he would instead answer the “negative questions” of media next week.
Asked by another journalist about Afghanistan, he said: “I want to talk about happy things, man.”
His spokeswoman Jen Psaki said at a daily press briefing: “We expect it [the withdrawal] to be completed by the end of August.”
Why is Bagram so important?
The airfield lies around 40km (25 miles) north of Kabul and is named after a nearby village.
Your device may not support this visualisation
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.
New York City firefighters and police were flown in to bury a piece of rubble from the World Trade Center, destroyed in the 9/11 attacks, on the territory of the base.
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?
The top US commander in Afghanistan, General Austin Scott Miller, met President Ashraf Ghani to discuss “continued US assistance and co-operation”, the president’s office said in a tweet on Friday.
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.
The Taliban stopped attacks on coalition forces after signing an agreement with the US in February of last year, when they also promised to end co-operation with international jihadist groups.
But the militants 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).
Twenty years of conflict in Afghanistan – what happened when?
From 9/11, to intense fighting on the ground, and now full withdrawal of US-led forces, here’s what happened.
Al-Qaeda, led by Osama Bin Laden in Afghanistan, carries out the largest terror attack ever conducted on US soil.
Four commercial airliners are hijacked. Two are flown into the World Trade Centre in New York, which collapses. One hits the Pentagon building in Washington, and one crashes into a field in Pennsylvania. Nearly 3,000 people are killed.
First air strikes
A US-led coalition bombs Taliban and al-Qaeda facilities in Afghanistan. Targets include Kabul, Kandahar and Jalalabad. The Taliban refuse to hand over Bin Laden. Their air defences and small fleet of fighter aircraft are destroyed.
Fall of Kabul
The Northern Alliance, a group of anti-Taliban rebels backed by coalition forces, enters Kabul as the Taliban flee the city.
By the 13 November 2001, all Taliban have either fled or been neutralised. Other cities quickly fall.
After protracted negotiations at a “loya jirga” or grand assembly, the new Afghan constitution is signed into law. The constitution paves the way for presidential elections in October 2004.
Hamid Karzai becomes president
Hamid Karzai, the leader of the Popalzai Durrani tribe, becomes the first president under the new constitution. He serves two five-year terms as president.
UK troops deployed to Helmand
British troops arrive in Helmand province, a Taliban stronghold in the south of the country.
Their initial mission is to support reconstruction projects, but they are quickly drawn into combat operations. More than 450 British troops lose their lives in Afghanistan over the course of the conflict.
US President Barack Obama approves a major increase in the number of troops sent to Afghanistan. At their peak, they number about 140,000.
The so-called “surge” is modelled on US strategy in Iraq where US forces focussed on protecting the civilian population as well as killing insurgent fighters.
Osama Bin Laden killed
The leader of al-Qaeda is killed in an assault by US Navy Seals on a compound in Abbottabad in Pakistan. Bin Laden’s body is removed and buried at sea. The operation ends a 10-year hunt led by the CIA. The confirmation that Bin Laden had been living on Pakistani soil fuels accusations in the US that Pakistan is an unreliable ally in the war on terror.
Death of Mullah Omar
The founder of the Taliban, Mullah Mohammed Omar, dies. His death is kept secret for more than two years.
According to Afghan intelligence, Mullah Omar dies of health problems at a hospital in the Pakistani city of Karachi. Pakistan denies that he was in the country.
Nato ends combat operations
At a ceremony in Kabul, Nato ends its combat operations in Afghanistan. With the surge now over, the US withdraws thousands of troops. Most of those who remain focus on training and supporting the Afghan security forces.
The Taliban launch a series of suicide attacks, car bombings and other assaults. The parliament building in Kabul, and the city of Kunduz are attacked. Islamic State militants begin operations in Afghanistan.
Death toll announcement
Afghan President Ashraf Ghani says more than 45,000 members of his country’s security forces have been killed since he became leader in 2014. The figure is far higher than previously thought.
US signs deal with Taliban
The US and the Taliban sign an “agreement for bringing peace” to Afghanistan, in Doha, Qatar. The US and Nato allies agree to withdraw all troops within 14 months if the militants uphold the deal.
Date for final withdrawal
US forces are scheduled to withdraw from Afghanistan by 11 September 2021, exactly 20 years since 9/11. There are strong indications that the withdrawal may be complete before the official deadline.