The final US military flight has left the Afghan capital, the Pentagon has announced, officially ending the United States’s 20-year war in Afghanistan after a chaotic evacuation effort.

General Kenneth McKenzie, commander of US Central Command, said that the US evacuated 79,000 people from Kabul, including 6,000 American citizens, since August 14, a day before the Taliban took control of the city.

“I’m here to announce the completion of our withdrawal from Afghanistan,” McKenzie told reporters during a news briefing at the Pentagon on Monday.

“Tonight’s withdrawal signifies both the end of the military component of the evacuation but also the end of the nearly 20-year mission that began in Afghanistan shortly after September 11, 2001.”

“Every single American service member is now out of Afghanistan. I can say that with absolute certainty,” McKenzie said on Monday.

The general added that US forces started the evacuations on August 14 with the assumption that Afghan security forces would be a “willing and able” partner, but the Taliban took over the capital a day later. That is when Washington started coordinating the evacuation efforts with the group.

“It’s important to understand that within 48 hours of the execution order, facts on the ground had changed significantly,” McKenzie said. “We have gone from cooperating on security with a longtime partner and ally to initiating a pragmatic relationship of necessity with a longtime enemy.”

The Taliban took over Afghanistan earlier this month after a blistering offensive, reaching Kabul on August 15 as President Ashraf Ghani fled the country and government forces collapsed.

US forces remained in control of the airport, however, as they worked to evacuate American citizens, third-country nationals and Afghan allies – and meet an August 31 troop withdrawal deadline set by President Joe Biden.