* Blasts leave dozens of bodies, wounded victims
* Western nations had warned of Islamic State threat
* Pentagon spokesman calls it a 'complex attack'
* U.S. to shift focus to getting last troops out
Islamic State struck the crowded gates of Kabul airport in a suicide bomb attack on Thursday, killing scores of civilians and at least 13 U.S. troops, disrupting the airlift of tens of thousands of Afghans desperate to flee.
Kabul health officials were quoted as saying 60 civilians were killed. Video shot by Afghan journalists showed dozens of bodies strewn around a canal on the edge of the airport. At least two blasts rocked the area, witnesses said.
Islamic State said one of its suicide bombers targeted "translators and collaborators with the American army". U.S. officials also blamed the group.
The American casualties, which increased to 13 from 12 later on Thursday according to U.S. officials, were believed to be the most U.S. troops killed in Afghanistan in a single incident since 30 personnel died when a helicopter was shot down in August 2011.
The attack was carried out as U.S. forces raced to complete their withdrawal from Afghanistan, after President Joe Biden said the United States had long ago achieved its original rationale for invading the country in 2001: to root out al Qaeda militants and prevent a repeat of the Sept. 11 attacks on the United States.
Biden vowed to go after the perpetrators of Thursday's bombing and said he had ordered the Pentagon to plan how to strike ISIS-K, the Islamic State affiliate that claimed responsibility.
"We will not forgive. We will not forget. We will hunt you down and make you pay," Biden said during televised comments from the White House.
Corpses were in the canal by the airport fence, video from the scene showed, some being fished out and laid in heaps while wailing civilians searched for loved ones.
"For a moment I thought my eardrums were blasted and I lost my sense of hearing. I saw bodies and body parts flying in the air like a tornado blowing plastic bags. I saw bodies, body parts, elders and injured men, women and children scattered," said one Afghan who had been trying to reach the airport. "That little water flowing in the sewage canal had turned into blood."
The U.S. deaths were the first in action in Afghanistan in 18 months, a fact likely to be cited by critics who accuse Biden of recklessly abandoning a stable and hard-won status quo by ordering an abrupt pullout.
General Frank McKenzie, head of U.S. Central Command, said the United States would press on with evacuations, noting that there were still around 1,000 U.S. citizens in Afghanistan. But several Western countries said the mass airlift of civilians was coming to an end, likely to leave no way out for tens of thousands of Afghans who worked for the West through two decades of war.
McKenzie said U.S. commanders were bracing for more attacks by Islamic State, including possibly rockets or vehicle-borne bombs targeting the airport.
"We're doing everything we can to be prepared," he said.
Violence by Islamic State is a challenge for the Taliban, who have promised Afghans they will bring peace to the country they swiftly conquered. A Taliban spokesman described the attack as the work of "evil circles" who would be suppressed once foreign troops leave.
Western countries fear that the Taliban, who once sheltered Osama bin Laden's al Qaeda, will allow Afghanistan to turn again into a haven for militants. The Taliban say they will not let the country be used by terrorists.
THREAT TO AIRPORT
Zubair, a 24 year-old civil engineer, who had been trying for nearly a week to get inside the airport with a cousin who had papers authorising him to travel to the United States, said he was 50 metres from a suicide bomber who detonated explosives at the gate.
"Men, women and children were screaming. I saw many injured people – men, women and children – being loaded into private vehicles and taken toward the hospitals," he said, adding that after the explosions there was gunfire.
Washington and its allies had been urging civilians to stay away from the airport, citing the threat from Islamic State.
In the past 12 days, Western countries have evacuated nearly 100,000 people. But they acknowledge that thousands will be left behind following Biden's order to pull out all troops by Aug 31.
The last few days of the airlift will mostly be used to withdraw the remaining troops. Canada and some European countries have already announced the end of their airlifts.
Biden ordered all troops out of Afghanistan by the end of the month to comply with a withdrawal agreement with the Taliban negotiated by his predecessor Donald Trump. Biden spurned calls this week from European allies for more time.
The collapse of the Western-backed government in Afghanistan caught U.S. officials by surprise and risks reversing gains, especially in the rights of women and girls, millions of whom have been going to school and work, once forbidden under the Taliban.
Biden has defended the decision to leave, saying U.S. forces could not stay indefinitely. But his critics say the U.S. force, which once numbered more than 100,000, had been reduced in recent years to just a few thousand, no longer involved in fighting on the ground and mainly confined to an air base. It was a fraction of the size of U.S. military contingents that have stayed in places such as Korea for decades.
Fighters claiming allegiance to Islamic State began appearing in eastern Afghanistan at the end of 2014 and have established a reputation for extreme brutality. They have claimed responsibility for suicide attacks on civilians, government targets and ethnic and sectarian minorities.