President Obama on Sunday marked the end of the U.S. combat mission in Afghanistan by calling it a “milestone” for the country and thanking American troops and others for their “extraordinary sacrifice,” including the more than 2,200 who died in the fight.

“On this day we give thanks,” the president said. “We are safer, and our nation is more secure because of their service.

“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.”

The 13-year occupation by the United States and its NATO allies started with airstrikes against Usama bin Laden's Al Qaeda and its Taliban protectors after the 9-11 terror attacks and ended Sunday with a ceremony at the joint-military headquarters in Kabul. 

As part of the ceremony, Gen. John Campbell, commander of the U.S.-led International Security Assistance Force, rolled up and sheathed the green-and-white ISAF flag and unfurled the flag of the new international mission, called Resolute Support.

More On This...

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

The passing of 2014 will not see the complete departure of American soldiers from Afghanistan, as the ISAF will transition to a supporting role with 13,500 soldiers, almost 11,000 of them American, starting Jan. 1.

ISAF was set up after the U.S.-led invasion as an umbrella for the coalition of about 50 nations that provided troops and took responsibility for security across the country.

Afghanistan President Ashraf Ghani, who took office in September, promptly 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.

In all, 2,224 American soldiers have been killed in Afghanistan, according to an Associated Press tally, out of roughly 3,500 foreign troop deaths. The mission peaked at 140,000 troops in 2010 with a surge ordered by Obama to remove the insurgents from 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 U.S. forces remaining in the country, allowing them to extend their counter-terrorism operations to the Taliban, as well as Al Qaeda, and to provide ground and air support for the Afghan forces for at least the next two years.

“Afghanistan remains a dangerous place, and the Afghan people and their security forces continue to make tremendous sacrifices in defense of their country,” the president said Sunday. “Our personnel will continue to face risks, but this reflects the enduring commitment of the United States to the Afghan people and to a united, secure and sovereign Afghanistan that is never again used as a source of attacks against our nation.”

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.

As Afghan forces take 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 $100 million on reconstruction in Afghanistan, on top of the $1 trillion war.

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 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, 11 to 14 years old, were wounded by shrapnel, said the governor's spokesman Attaullah Khogyani. He blamed the Taliban.

This has also been a deadly year for Afghanistan's security forces -- army, paramilitary and police -- with about 5,000 deaths recorded so far. Most of the dead, roughly 3,200, have been policemen, says 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.

NATO's Secretary Gen. Jens Stoltenberg has said that the Afghan 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.

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.

The Associated Press contributed to this report.