WASHINGTON (AP) — Top U.S. intelligence officials were questioned Tuesday about why they misjudged the durability of governments in both Afghanistan and Ukraine, and whether they need to reform how intelligence agencies assess a foreign military’s will to fight.

U.S. intelligence believed the U.S.-backed Kabul government would hold out for months against the Taliban and thought Russian forces would overrun Ukraine in a few weeks. Both assessments were wrong. The U.S. and Western allies are now rushing to aid Ukraine's resistance against Russia in what has turned into a grinding, violent stalemate.

“What we missed was the will to fight of the Ukrainians...and we also missed that in Afghanistan,” said Sen. Angus King, an independent from Maine, at a hearing of the Senate Armed Services Committee. He added, “I realize will to fight is a lot harder to assess than number of tanks or volume of ammunition or something. But I hope the intelligence community is doing some soul-searching about how to better get a handle on that question.”

President Joe Biden's administration disclosed in advance Russian President Vladimir Putin's intentions to invade Ukraine, a public campaign that it says built support for crushing sanctions on the Russian economy and military support from NATO members. Top U.S. officials have gone to Kyiv to meet with President Volodymyr Zelenskyy and pledged more military and intelligence support.

Avril Haines, the U.S. director of national intelligence, said that “will to fight” and “capacity to fight” in tandem were difficult to predict. The National Intelligence Council, a group of advisers that reviews the agencies as a whole, is studying the issue, she said.

“The two of them are issues that are, as you indicated, quite challenging to provide effective analysis on,” Haines told King. “And we're looking at different methodologies for doing so.”

The U.S. might have done more before the invasion to assist Zelenskyy had lawmakers believed Kyiv had more of a chance, King said. And after predictions that the Taliban would be held back as long as a year after the American withdrawal, the coalition-backed government “lasted minus-two weeks,” King noted, a reference to the Taliban overrunning Kabul before the withdrawal formally ended.

The U.S. was forced to negotiate with the Taliban to evacuate of thousands of American citizens and Afghan allies fighting huge crowds to secure space on evacuation flights. An attack at the Kabul airport killed 13 U.S. troops and at least 170 Afghan civilians.

King raised his voice to cut off Lt. Gen. Scott Berrier, head of the Defense Intelligence Agency, after Berrier said he believed the intelligence agencies had done “a great job.”

“General, how can you possibly say that when we were told explicitly, Kyiv would fall in three days and Ukraine would fall in two weeks?” he said. "You're telling me that was accurate intelligence?

U.S. intelligence believed before the war Russia's forces were so much larger and more powerful than Ukraine's that “it wasn't going to go very well for a variety of factors,” Berrier said.

He testified Tuesday that “there was never an intelligence community assessment that said the Ukrainians lacked the will to fight.” That appears to contradict his statement from Senate testimony in March, when Berrier said he "questioned their will to fight. That was a bad assessment on my part because they have fought bravely and honorably and are doing the right thing.”

Copyright 2022 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.