WASHINGTON - President Barack Obama has lauded the official end of the 13-year US combat mission in Afghanistan, offering his remarks to coincide with a handover ceremony on Kabul.

At the same time, he cautioned that Afghanistan remains a dangerous place.

“Afghanistan remains a dangerous place, and the Afghan people and their security forces continue to make tremendous sacrifices in defence of their country,” Obama said in a statement on Sunday. The US president noted that at the invitation of the Afghan government, and to preserve the gains made together, the United States-along with its allies and partners will “maintain a limited military presence in Afghanistan to train, advise and assist Afghan forces and to conduct counterterrorism operations against the remnants of al Qaeda.”

“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,” he said in a White House statement after NATO formally ended the combat at a ceremony.

“On this day, we give thanks to our troops and intelligence personnel who have been relentless against the terrorists responsible for 9/11 - devastating the core Al Qaeda leadership, delivering justice to Osama bin Laden, disrupting terrorist plots and saving countless American lives. We are safer, and our nation is more secure, because of their service,” he said.

A ceremony was held Sunday at the headquarters for NATO’s mission in Kabul, officially transferring responsibility for battling the Taliban from US-led forces to Afghanistan’s own security forces.

 Some American soldiers will remain in a support capacity for the government of President Ashraf Ghani; the new international mission is called “Resolute Support.”

Meanwhile, Barack Obama said Washington was not ready to open an embassy in Iran due to differences over nuclear policy, a position that contrasts with his new approach to Cuba. “I never say never, but I think these things have to go in steps,” Obama said in an interview with National Public Radio that aired Monday, regarding re-opening the long-shuttered US mission in Tehran.

“Cuba is a circumstance in which for 50 years, we have done the same thing over and over again, and there hadn’t been any change,” Obama told NPR December 19 in the White House, shortly before he flew to Hawaii for a family vacation.

“And the question was, should we try something different with a relatively tiny country that doesn’t pose any significant threat to us or our allies?”

By contrast, Obama said, Iran is “a large, sophisticated country that has a track record of state-sponsored terrorism, that we know was attempting to develop a nuclear weapon - at least the component parts that would be required to develop a nuclear weapon.”

Whether or not to improve US diplomatic ties and ease existing sanctions on Iran rests in large part on the outcome of current negotiations between global powers and Tehran on the Islamic republic’s nuclear program, Obama added.

“If we can take that big first step, then my hope would be that that would serve as the basis for us trying to improve relations over time.”

On November 24 Iran and the so-called P5+1 (The United States, Britain, China, Russia, France and Germany) agreed to renew their interim agreement from the previous year and extend their discussions until July 1, 2015 to obtain a final agreement that would prevent Iran’s development of a nuclear bomb, in exchange for the lifting of international sanctions.

Obama announced on December 17 that Washington would reopen its embassy in Havana.