President Barack Obama said on Sunday the longest war in American history was coming to a responsible conclusion.

Obama was welcoming the end of US combat operations in Afghanistan, which was marked with a ceremony in Kabul.

Obama, who is on vacation in Hawaii, said in a statement that the international effort in Afghanistan had devastated al-Qaida’s core leadership, brought justice to Osama bin Laden and disrupted terrorist plots. He said US troops and diplomats had helped Afghans reclaim their communities and move toward democracy.

“We honor the profound sacrifices that have made this progress possible,” said Obama. “We salute every American – military and civilian, including our dedicated diplomats and development workers – who have served in Afghanistan, many on multiple tours, just as their families have sacrificed at home.”

Obama honored the more than 2,200 Americans who have died in Afghanistan since the war started 13 years ago. Obama said those years had tested the US and its military. From a peak 140,000 troops in 2010, the US and Nato plan to leave just 13,500 behind.

“These past 13 years have tested our nation and our military,” Obama said. “But compared to the nearly 180,000 American troops in Iraq and Afghanistan when I took office, we now have fewer than 15,000 in those countries. Some 90% of our troops are home.”

The insurgency such troops fought for 13 years, however, remains as ferocious and deadly as at any time since the 2001 invasion that unseated the Taliban regime following the 11 September attacks.

Sunday’s ceremony marked the end of the US-led International Security Assistance Force (Isaf), which will transition to a supporting role starting on 1 January. General John Campbell, commander of Isaf, rolled up and sheathed the green and white Isaf flag and unfurled the flag of the new international mission, called Resolute Support.

“Resolute Support will serve as the bedrock of an enduring partnership” between Nato and Afghanistan, Campbell told an audience of Afghan and international military officers and officials, as well as diplomats and journalists. He paid tribute to the international and Afghan troops who have died fighting the insurgency, saying: “The road before us remains challenging but we will triumph.”

The new mission will provide training and support for Afghanistan’s military, with the US accounting for almost 11,000 members of the residual force.

Later on Sunday the defense secretary, Chuck Hagel, released a statement in which he heralded the US effort in Afghanistan and announced the name of the US mission which will replace Operation Enduring Freedom.

“In Operation Freedom’s Sentinel,” Hagel said, “the United States will pursue two missions with the support of the Afghan government and the Afghan people. We will work with our allies and partners as part of Nato’s Resolute Support mission to continue training, advising, and assisting Afghan security forces. And we will continue our counterterrorism mission against the remnants of al-Qaida to ensure that Afghanistan is never again used to stage attacks against our homeland.”

President Ashraf Ghani, who took office in September, signed bilateral security agreements with Washington and Nato allowing the enduring military presence. The move has led to a spike in violence as the Taliban have claimed it as an excuse to step up operations aimed at destabilizing his government.

Isaf was set up after the US-led invasion as an umbrella for the coalition of around 50 nations that provided troops and took responsibility for security across the country. It ends with 2,224 American soldiers killed, according to an AP tally, out of a total of some 3,500 foreign troop deaths.

The mission peaked in 2010 with a surge ordered by Obama to root the insurgents out of strategically important regions, notably in the southern provinces of Helmand and Kandahar, where the Taliban had its capital from 1996 to 2001.

Obama recently expanded the remit of the US forces remaining in the country, allowing them to extend their counter-terrorism operations to Taliban, as well as al-Qaida, and to provide ground and air support for Afghan forces when necessary for at least the next two years.

Afghans have mixed feelings about the drawdown of foreign troops, many believing that with the deteriorating security situation their presence is needed to back up the Afghan effort to bring peace after more than three decades of continual war.

“At least in the past 13 years we have seen improvements in our way of life – freedom of speech, democracy, the people generally better off financially,” said 42-year-old shop keeper Gul Mohammad. “But we do need the foreign troops to stay here at least until our own forces are strong enough, while our economy strengthens, while our leaders try to form a government,” he said.

Nato secretary general Jens Stoltenberg has said that Afghanistan’s 350,000-strong security forces are ready to take on the insurgency alone, despite complaints by officials that they lack the necessary assets, such as air support, medical evacuation and intelligence.

In a statement on Sunday, Stoltenberg said Isaf’s mandate was “carried out at great cost but with great success”.

“We have made our own nations safer by denying safe haven to international terrorists. We have made Afghanistan stronger by building up from scratch strong security forces. Together we have created the conditions for a better future for millions of Afghan men, women and children,” he said.

As Afghan forces assume sovereignty, the country is without a cabinet, three months after Ghani’s inauguration, and economic growth is near zero due to the reduction of the international military and aid juggernauts. The United States spent more than $100m on reconstruction in Afghanistan, on top of the $1tn war effort.

This year is set to be the deadliest of the war, according to the United Nations, which expects civilian casualties to hit 10,000 for the first time since the agency began keeping records in 2008. It says that most of the deaths and injuries are caused by Taliban attacks.

In the latest insurgent violence in eastern Wardak province, two teenage boys were killed late on Saturday, when a rocket was fired near a children’s volleyball match in Nirkh district, an official said. Another five children, aged between 11 and 14 years old, were wounded by shrapnel, said the governor’s spokesman Attaullah Khogyani. He blamed the Taliban.

In Kapisa, also in the east, Governor Abdul Saboor Wafa’s office said eight insurgents were killed on Saturday night in an army counter-insurgency operation.

This has also been a deadly year for Afghanistan’s security forces – army, paramilitary and police – with around 5,000 deaths recorded so far. Most of those deaths, or around 3,200, have been policemen, according to Karl Ake Roghe, the outgoing head of Eupol, the European Union Police Mission in Afghanistan, which funds and trains a police force of 157,000.

Roghe said that while the Taliban have stretched their presence, the methodology has not changed, indicating a lack of insurgent military capacity despite the rise in attacks.

“They make a lot of damage, they send gunmen and suicide bombers to blow up the front wall and then they are immediately killed, so they achieve nothing,” he said.