WASHINGTON (AP) — The warnings were clear: The Afghan government would likely fall once U.S. troops pulled out. But intelligence agencies and ultimately President Joe Biden missed how quickly it would happen, losing weeks that could have been used for evacuations and spurring a foreign policy crisis.Without a sense that the country could collapse so quickly, the administration heard out Afghan President Ashraf Ghani when he met face-to-face with Biden in June. Biden says Ghani pressed him to hold off on any urgent evacuation of Americans, arguing that it would be inviting the Taliban to advance more quickly -- as it turned out they did anyway -- and telling the Afghan army to give up.It was an ask that Biden heeded, despite more than a decade of deep-rooted skepticism of the competence of the Afghan government and military, marred by widespread corruption and mismanagement.Biden on Wednesday blamed Ghani for fleeing the country and Afghan forces for surrendering so easily to the Taliban. He told ABC News that he believed the problems with the withdrawal were inevitable.“The idea that somehow, there’s a way to have gotten out without chaos ensuing, I don’t know how that happens,” he said.U.S. officials estimate that as many as 10,000 Americans remain in Afghanistan, and tens of thousands of Afghans who fought alongside or aided the U.S. in the nearly two-decade occupation are struggling to get out.Biden’s assertion on Monday that some Afghans, “still hopeful for their country,” didn’t want to leave has been widely criticized. The State Department has a backlog of tens of thousands of visa applications from those who have been trying for years to depart the country ahead of the U.S. withdrawal. That is now set for Aug. 31, though Biden said Wednesday Americans would not be left behind.While analysts have long warned that the Afghan government would be in grave danger without American support, they didn’t anticipate the speed at which it would fall to the Taliban.That miss is sparking instant reviews of what went wrong, current and former U.S. officials said, speaking only on condition of anonymity because they were not authorized to speak publicly on the subject.As recently as two weeks ago, intelligence agencies in briefings to lawmakers gave no warning that the Afghan government faced imminent collapse, an official familiar with the briefings said.A defense estimate that Kabul could be surrounded within 30 days — an assessment that was viewed as pessimistic when it was reported last week — turned out instead to be far too optimistic. In just over a week, the Taliban overran the country and entered Kabul without a fight. Ghani and his top aides fled.Gen. Mark Milley, chairman of the Joint Chiefs of Staff, insisted Wednesday that he had no indication of the speed of the Afghan collapse.“There was nothing that I or anyone else saw that indicated a collapse of this army, and this government, in 11 days,” he said.One senior intelligence official said agencies did identify the risk of a rapid collapse of the Afghan government and grew “more pessimistic” during the last several months of the Afghan fighting season.“That said, the Afghan government unraveled even more quickly than we anticipated,” the official said.Analysts have for years warned that the American withdrawal would destabilize Afghan forces trained at great U.S. expense and still heavily reliant on U.S. air power and intelligence gathering, current and former officials said. Withdrawal also would risk damaging the morale of Afghan units who had fought alongside U.S. and coalition forces for two decades and would be left to face a resurgent Taliban on their own.A public threat assessment in April warned that Afghan forces “will struggle to hold the Taliban at bay if the coalition withdraws support.”One administration official said the intelligence community had reported to the White House that a rapid military collapse following the withdrawal would be possible as the Taliban took key provincial capitals. In fact, that occurred within a matter of days leading up to the fall of Kabul.And the anticipated danger was not limited to Afghanistan itself. Analysts had also warned that new terrorist threats would likely emerge from the country if the Taliban were to take power. According to a former official, one assessment predicted that a large-scale terrorist attack could be planned in Afghanistan within one to three years of the withdrawal.Many have blamed an intelligence failure for failing to anticipate the speed with which the Afghan government would collapse. Some current and former intelligence officers have pushed back.Marc Polymeropoulos, who served in the CIA for nearly three decades, said that the intelligence community had always been clear amid a renewed focus on the mistaken 30-day time frame.“Whether it’s six days or 30 days, I don’t see the IC as ever having made any kind of rosy predictions or cherry-picked at all,” he said.But Chris Miller, who deployed to Afghanistan in 2001 and later was the nation’s top counterterrorism official and acting defense secretary under former President Donald Trump, called the missed speed “an intelligence failure of cataclysmic proportions.”“We have something fundamentally wrong with the way we do our intelligence assessments in our country,” he said. “It’s cultural and technological arrogance. This was so predictable how this was going to go down.”Other elements of the U.S. government were pushing Americans and others to leave months ago, with ever-more-dire warnings, culminating with an urgent Aug. 7 State Department plea for them to leave, offering to provide funding for Americans to get out of Afghanistan.Some U.S. officials believe they may have bought into the leaked intelligence assessment that the Afghan government could hold onto Kabul for a month or longer. Officials maintain that those assessments were not released publicly, and were only best estimates. For all of the focus on intelligence failures, the officials say the State Department warnings should have pushed most Americans to leave Afghanistan weeks ago.Now, the U.S. is working with the Taliban to ensure safe passage for Americans and Afghans who helped the 20-year war effort and are frantically trying to reach Kabul’s international airport. As the Taliban take hold, the State Department has said it cannot guarantee them safe passage to the airport.___Associated Press writer Eric Tucker contributed to this report.