The now-viral image, obtained and posted by the respected military news site Defense One, was taken inside a US Air Force C-17 transport.
The Afghans crammed in the giant cargo hold on the Sunday night flight were among those approved for evacuation by US authorities, according to the site.
The US military said about 640 Afghans were on board.
But such a large number on one flight was not planned, a US official told Defense One — many climbed onto the half-open ramp at the back of the plane in desperation.
“The crew made the decision to go” rather than force them out, the official said.
It came as Taliban fighters flooded the streets of Kabul, with panicked citizens rushing to the airport to try and find a flight out of Afghanistan.
“The unusually high number of passengers aboard this aircraft… was the result of a dynamic security environment that necessitated quick decision making by the crew,” US Central Command spokesperson Karen Roxberry said in a statement.
It “ultimately ensured that these passengers were safely taken outside the country”.
Among the people visible in the photo is a small child holding a feeding bottle in the lap of a woman. Several other people are seen holding small children.
Hardly any belongings are visible among the passengers, except a small suitcase and a backpack in the foreground.
The flight — which Defense One said had the call sign Reach 871 — landed in Qatar in the early hours of Monday, according to the tracking website FlightAware.
The US military did not specify the destination.
This C-17 was not the only one to take so many Afghans out of the country — Defense One cited the US official as saying several planes took off from Kabul with similar numbers.
It is also not the first time Boeing C-17s — workhorses of the US Air Force transport fleet — have been used for such a large evacuation.
In 2013, a US C-17 flew out more than 670 people from the eastern Philippines after Typhoon Haiyan.
In its usual configuration, a C-17 carries just over 100 troops with equipment.
– Chaos, desperation –
There have been desperate and chaotic scenes at Kabul airport, where the apron and runway were flooded Monday by thousands of people hoping to get a flight out of the country.
Many were not eligible for evacuation flights, did not have tickets on commercial flights or even visas.
In harrowing videos shared on social media, hundreds of people are seen running next to a C-17 as it appears to gather speed, some clinging to the sides of the plane.
In another, attack helicopters are seen flying low near the crowds in an apparent attempt to clear the runway for an aircraft.
Afghan media reported that several people died after falling from planes as they took off.
One person died in the landing gear well of a C-17 that took off from Kabul, the Washington Post and Politico reported.