Mattis however refused to give a firm number for how many troops US President Donald Trump would commit under a new strategy, just two years after NATO officially ended its post-9/11 combat role in Afghanistan.

Recent Taliban gains have shaken confidence in Afghanistan s future and talk of sending NATO troops in has stoked fears the alliance could get sucked back into an unwinnable war just when it faces a host of new threats including Russia, terrorism and cyberattacks.

“I don t put timelines on war, war is a fundamentally unpredictable phenomenon,” the US defence secretary told reporters after meeting his counterparts from the 29-nation alliance.

“The bottom line is that NATO has made a commitment to Afghanistan for freedom from fear and terror, and freedom from terror demands that you can t let this be undone.”

Citing both Afghanistan and “ungoverned spaces” in Syria and Iraq where the Islamic State group has flourished, the retired Marine general added: “You cannot say I am tired of it and come home and then you get hit again.”

NATO currently has 13,500 troops in Afghanistan in the Resolute Support mission to “train, advise and assist” Afghan troops.

Diplomatic sources said an increase of up to 3,000 was under considerations, while US officials say it might be nearer 4,000.

The United States, which once had more than 100,000 troops in Afghanistan, is preparing a new strategy for a war which has dragged on for 16 years and which even US generals concede is a “stalemate” at best.

NATO played the lead role in fighting the Afghan war from 2003 to the end of 2014, when it handed frontline duties to the Afghan military.

Mattis said that after talks with the allies about 70 percent of the new plan s requirements were in place and he looked forward to bridging the remaining gap.

NATO chief Jens Stoltenberg confirmed that the alliance would increase troop numbers, with 15 countries having pledged more, but stressed there would be no new combat role.

“We don t think it s going to be peaceful and no conflicts and no violence there this year or next year or in the near future, but we believe that Afghans (are) … determined and committed to fight Taliban and to stabilise their own country,” he said.

The extra troops could help bolster Afghan special forces, improve Kabul s air force to provide ground support and evacuations, and step up officer training, the former Norwegian premier added.

He insisted it was not wrong to end NATO s combat role in 2014, adding: “If anything, we should have done it before.”

Mattis however disagreed, saying there was “pretty much a consensus that we may have pulled our troops out a little too rapidly.”

British Defence Secretary Michael Fallon said London would provide nearly 100 troops, on top of 500 already in Afghanistan.