Officials said the last C17 aircraft took off with the US ambassador onboard after midnight local time on Tuesday.
They added that the diplomatic mission to assist those unable to leave before the deadline would continue.
Celebratory gunfire by the Taliban was heard after the last plane departed.
The aircraft’s departure was the final chapter in a contentious military effort, which eventually saw the US handing Afghanistan back to the very Islamist militants it sought to root out when American troops entered the country in 2001.
It also was the end of a massive evacuation effort that began on 14 August soon after the Taliban took over the country.
America’s top military commander in the region, Gen Kenneth McKenzie, said that in total, US and coalition aircraft evacuated more than 123,000 civilians – an average of more than 7,500 civilians per day during that time.
Speaking after the announcement, US Secretary of State Anthony Blinken called the evacuation a “massive military, diplomatic and humanitarian undertaking” and one of the most challenging the US has ever carried out.
“A new chapter has begun,” he said. “The military mission is over. A new diplomatic mission has begun.”
He said the Taliban needed to earn its legitimacy and would be judged on the extent to which it fulfilled its commitments and obligations to allow civilians free travel to and from the country, protected the rights of all Afghans including women, and prevented terror groups from gaining a foothold.
He added that while the US had suspended its diplomatic presence in Kabul, transferring operations to the Qatari capital of Doha, it would continue its “relentless efforts” to help Americans, and Afghans with US passports, to leave Afghanistan if they wanted to.
President Joe Biden issued a short statement thanking all those involved in the evacuation operation over the last 17 days and saying he would address the nation later on Tuesday.
Following the pullout, Taliban fighters were seen exploring Kabul airport and taking over its facilities, including a hangar with aircraft apparently left behind by the US. Some fighters were wearing discarded US military uniforms and equipment.
A Los Angeles Times photojournalist on the scene said the fighters were already organising supplies, checking equipment that was left behind and securing the perimeter.
Meanwhile, the US has yet to explain reports that a US drone strike on a suspected suicide bomber in Afghanistan killed a number of civilians, including six children and a man who worked as a translator for US forces.
Relatives said the strike, on a car near Kabul airport, was based on wrong information. The Pentagon said it was assessing and investigating the reports. (Courtesy BBC)