Mr Obama, accompanied by the First Lady Michelle Obama and vice-president Joe Biden and his wife, Jill, marked the day by pausing for a moment’s silence on the South Lawn of the White House in Washington at 8:46am. This was the exact moment the first terrorist plane, American Airlines 11, crashed into the north tower of the World Trade Center on 11 September 2001.
Almost 3,000 people were killed in the attacks which triggered an on-going conflict against al-Qaeda extremists and their supporters in Afghanistan.
The president later laid a wreath at the Pentagon, which was struck by another plane, where 184 people lost their lives.
“Let us have the strength to face the threats that endure, different though they may be from 12 years ago, so that as long as there are those who would strike our citizens, we will stand vigilant and defend our nation,” Mr Obama said at a private observance for family members of those who died there.
“We pray for the memory of all those taken from us – nearly 3,000 innocent souls,” Mr Obama said.
“Our hearts still ache for the futures snatched away, the lives that might have been,” he said, “They left this earth. They slipped from our grasp.”
Quoting the Bible, Obama spoke of “the miracle of restoration,” paying tribute to the resilient spirit of victims’ families, saying he was “amazed at the will that you’ve summoned in your lives to lift yourselves up and to carry on.”
The president acknowledged the decade of conflict that has followed the attacks. He paid tribute to the four Americans, including the US ambassador, who were killed in an Islamist militant attack on a US diplomatic compound in Benghazi, Libya, on 11 September last year.
“We pray for all those who’ve stepped forward in those years of war,” he said.
Just 12 hours earlier, Mr Obama had given a nationally televised address to a war-weary nation about the possible need for military action against Syria if diplomatic initiatives fail to get Syria’s leader Bashar al-Assad to give up his chemical weapons.
In New York, hundreds of people also gathered at 8:46am to mark a moment’s silence at the site of the Twin Towers. Bagpipers broke the silence before a roll-call of the names of all those who died was read out.
Another moment of silence was held at 9:03am – when the second jetliner, United Airlines Flight 175, crashed into the World Trade Center’s south tower.
Meanwhile in south-western Pennsylvania, where United Flight 93 crashed into a field, a bell tolled after the names of each of the passengers and crew members was read out. Crew members of the USS Somerset rang the bells.
The navy named the ship in honour of Flight 93 passengers who fought back against their hijackers. Forty passengers and crew died in Somerset county when the plane went down.
It was believed to have been heading for a target in Washington.
Members of Congress also gathered on the steps at Capitol Hill to mark the occasion.
House Speaker, John Boehner, said: “This moment is to pray for the families of the departed, and to ask God to renew our strength and replenish our grace, so that we may press on and serve without growing weary, and walk without growing faint towards that more perfect union of our founders’ dreams.
“That is why we return to these steps today, that is why we will always return. And that is why we will never forget.”
Karen Hinson, who lost her 34-year-old brother, Michael Wittenstein, in New York and whose body was never found, said: “No matter how many years pass, this time comes around each year – and it’s always the same.”