https://www.bbc.com-Top US General Mark Milley has warned al-Qaeda terrorists in Afghanistan could threaten the US in as little as 12 months.
The Taliban had not broken ties with the group responsible for 9/11 and themselves remained a terror organisation, Gen Milley said.
He and Defence Secretary Lloyd Austin are being questioned in Congress about last month’s pullout from Afghanistan.
The government collapsed as the Taliban rapidly advanced through the country.
Senator and committee leader Jack Reed said lawmakers wanted to understand whether the US “missed indicators” of the government’s collapse.
The US has said it will now move towards counter-terrorism missions.
The hearing, held by the Senate armed services committee, comes weeks after a chaotic withdrawal at Kabul airport as foreign powers sought to get their citizens home and thousands of desperate Afghans begged for rescue.
A suicide attack killed 182 people during the withdrawal operation. Thirteen US service personnel and at least 169 Afghans were killed by the airport gate on 26 August.
Tuesday’s hearing began with opening testimony from Defence Secretary Lloyd Austin followed by Gen Milley.
Gen Milley said the US would have to continue to protect its people from terrorist attacks from Afghanistan, and that mission would now be harder.
“The Taliban was and remains a terrorist organisation and still has not broken ties with al-Qaeda,” he said.
“A reconstituted al-Qaeda or ISIS [Islamic State group] with aspirations to attack the US is a very real possibility, and those conditions to include activity in ungoverned spaces could present themselves in the next 12-36 months.”
Gen Milley said he made an assessment in late 2020 that an accelerated troop withdrawal from Afghanistan could precipitate the government’s collapse.
But both he and Mr Austin both testified that the speed of the collapse caught the US military off-guard.
“The fact that the Afghan army we and our partners trained simply melted away – in many cases without firing a shot – took us all by surprise,” Mr Austin said.
Another US general, Kenneth McKenzie, is also appearing. As head of US Central Command, he oversaw the withdrawal from Afghanistan.
The three men are now answering questions from members of Congress.
US troops first entered Afghanistan in late 2001, shortly after the 9/11 attacks. By the time they left, the US had spent about $985bn (£724bn) and deployed tens of thousands of troops, peaking at 110,000 in 2011.
In the weeks between the fall of Kabul and the withdrawal deadline of 31 August, the US evacuated its remaining 4,000 troops. It is also taking about 50,000 Afghan refugees who were airlifted out of Kabul.
As many as 20 people died in the crowds which gathered at the airport in the days after the Taliban takeover.
Gen Milley is facing tough questioning, especially from Republicans, who have called for him to be sacked.
He and Gen McKenzie will probably be asked about a US drone strike in Kabul on 29 August which killed 10 innocent members of a single family.
After the attack, Gen McKenzie said US intelligence had tracked a car belonging to one member of the family, an aid worker, believing it was linked to a branch of the Islamic State (IS) group.
Gen Milley originally described the attack as a “righteous strike”. After the Pentagon established that the dead were all civilians, he backtracked, admitting that he had spoken too soon.
‘We are not going to attack you’
The phone calls were revealed in a book by journalist Bob Woodward, who also said Gen Milley had told his staff that if Mr Trump ordered a nuclear strike, then he would have to confirm it before it was carried out.
Top Republican Senator Marco Rubio has described this as “treasonous”.
But Gen Milley told the hearing the calls were coordinated with then-Defence Secretary Mark Esper and his acting successor Christopher Miller.
“I know, I am certain that President Trump did not intend to attack the Chinese… and it was my directive responsibility by the secretary to convey that intent to the Chinese.
“My task at that time was to de-escalate. My message again was consistent: ‘Stay calm, steady and de-escalate. We are not going to attack you.'”