United States President Joe Biden on Monday defended his decision to withdraw the country’s forces from Afghanistan, but added that the situation unfolded “more quickly than we had anticipated”.

His statement came two days after the Taliban seized Afghanistan on Sunday evening, ending a 20-year war. They made rapid advances through the country amid the withdrawal of foreign troops. Afghanistan President Ashraf Ghani left the country on Sunday, reportedly for neighbouring Tajikistan.

The Taliban’s takeover has led to a humanitarian crisis, with thousands of people desperate to flee the country thronging Kabul airport. Biden has faced sharp criticism for the manner in which the US withdrawal was implemented.

Responding to the criticism, Biden said on Monday that the US’ mission in Afghanistan was never supposed to have been nation-building. “Our only vital national interest in Afghanistan remains today what it has always been: preventing a terrorist attack on American homeland,” he said.

Biden said that he stood squarely behind his decision to withdraw troops from the country. “After 20 years, I’ve learned the hard way that there was never a good time to withdraw US forces.”

The US president criticised Afghanistan’s political leaders and military for giving in to the Taliban. He said that the United States paid salaries for the Afghan military and provided for the maintenance of their air force. Biden also noted that the Taliban does not have an air force.

“We gave them every chance to determine their own future,” Biden said. “What we could not provide them was the will to fight for that future.”

“American troops cannot and should not be fighting in a war and dying in a war that Afghan forces are not willing to fight for themselves,” the US president further remarked.

Biden, however, said that the US would mount a swift and forceful response if the Taliban were to attack its personnel during their withdrawal process. “We will defend our people with devastating force if necessary,” he said.

The US president called the scenes that were coming out of Afghanistan “gut-wrenching.” He, however, said that the country did not begin evacuating Afghan civilians sooner partly because some Afghans did not want to leave earlier and were still hopeful.

“And part of it was because the Afghan government and its supporters discouraged us from organising a mass exodus to avoid triggering, as they said, “a crisis of confidence”,” Biden said.

The Taliban seized power in Kabul, the capital, on Sunday after having made rapid advances in large parts of Afghanistan over the preceding few weeks.

All foreign troops are slated to withdraw from the country by the end of August.

More than 1,000 people have been killed in Afghanistan in the last month, the BBC reported, citing the United Nations.