There was celebratory gunfire and fireworks across the Afghan capital as the last US troops left Afghanistan on Monday, just before the Aug. 31 deadline agreed with the Taliban.
Just two weeks ago, the Taliban had taken Kabul as President Ashraf Ghani fled the country.
The Pentagon said the last flight had left, and all US military forces were now out of Afghanistan.
"Tonight 12:00 pm (Afghanistan time) the last American soldier left Afghanistan. Our country gained full independence. Praise be to Allah. Heart-felt congratulations to all countrymen!," Suhail Shaheen, the group’s spokesman, said on Twitter.
“Thank God all the occupiers have left our country completely," tweeted Mohammad Naeem, a spokesman for the Taliban’s political office in Qatar.
"We made history again," tweeted Anas Haqqani, a senior official in the group. "The 20-year long occupation of Afghanistan by the United States & NATO has ended tonight ..."
Videos of spokesman Zabihullah Mujahid addressing a group of fighters at Kabul airport were also posted online.
Many Afghans who worked with Western forces, fearing retribution, have left Afghanistan. All eyes are now on the Taliban over what kind of a rule they will impose in the ethnically divided country. The group says it is in the process of forming an "inclusive" government.