Image caption The US military has continued to train the Afghan army

US Defence Secretary James Mattis has said that the withdrawal of US troops from Afghanistan was done too rapidly.

Mr Mattis was briefing Nato allies on future strategy, amid reports the US will boost its military presence.

His comments were in direct contrast to Nato's secretary-general, who said the withdrawal should have happened sooner.

US troops reached 130,000 in 2011 but were drawn down, leaving the Afghan military in control at the end of 2014. There are now 13,500 Nato troops there.

Mr Mattis was speaking at a press conference after meeting Nato defence ministers in Brussels.

He said: "Looking back on it, it's pretty much a consensus that we may have pulled our troops out too rapidly, reduced the numbers a little too rapidly."

Image copyright Reuters Image caption Defence Secretary James Mattis: "I don't put timelines on war"

However, Nato Secretary-General Jens Stoltenberg insisted it was right to end Nato's combat role in 2014, saying: "If anything, we should have done it before."

Diplomatic and US sources have suggested the number of US troops could increase by between 3,000 and 5,000 to try to counter a resurgent Taliban and the presence of an Afghan branch of so-called Islamic State.

Mr Mattis said: "I don't put timelines on war; war is a fundamentally unpredictable phenomenon.

"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."

The conflict in Afghanistan has dragged on for 16 years, since the 9/11 attacks in the United States.

Image copyright EPA Image caption Afghan forces in Helmand face a resurgent Taliban

At the end of 2014, Nato assumed the Resolute Support mission, helping train the Afghan military while handing over frontline combat duties.

Mr Stoltenberg said there would be more Nato troops for Afghanistan but gave no precise figure and said they would not be in combat roles.

UK Defence Secretary Michael Fallon pledged 100 more troops on top of 500 already in Afghanistan.

"We're in it for the long haul," he said.

Afghanistan has been hit by numerous violent attacks in recent weeks, including a massive bomb attack in the capital, Kabul, that killed more than 150 people.