"I am very mindful that mere words cannot match the depth of your sorrow, nor can they heal your wounded hearts," Obama said at an evening vigil in the grieving community of Newtown, Conn. "I can only hope that it helps for you to know that you are not alone in your grief."
The massacre of 26 children and adults at Sandy Hook Elementary on Friday elicited horror around the world, soul-searching in the United States, fresh political debate about gun control and questions about the incomprehensible - what drove the suspect to act.
It also left a newly re-elected president openly grappling for bigger answers. Obama said that in the coming weeks, he would use "whatever power this office holds" to engage with law enforcement, mental health professionals, parents and educators in an effort to prevent more tragedies like Newtown.
"Can say that we're truly doing enough to give all the children of this country the chance they deserve to live out their lives in happiness and with purpose? I've been reflecting on this the last few days," Obama said, somber and steady as some in the audience wept.
"If we're honest without ourselves, the answer is no. And we will have to change."
He promised to lead a national effort, but left unclear was what it would be, and how much it would address the explosive issue of gun control.
"What choice do we have?" Obama said. "Are we really prepared to say that we're powerless in the face of such carnage, that the politics are too hard?"
As Obama read some of the names of victims early in his remarks, several people broke down, their sobs heard throughout the hall.
He closed his remarks by slowly reading the first names of each of the 26 victims.
"God has called them all home. For those of us who remain, let us find the strength to carry on and make our country worthy of their memory," he said.
For Obama, ending his fourth year in office, it was another sorrowful visit to another community in disbelief. It is the job of the president to be there, to listen and console, to offer help even when the only thing within his grasp is a hug.
All the victims were killed up close by multiple rifle shots.
The toll: six adults. Twenty boys and girls, all of whom were just 6 or 7 years old.
Inside the vigil children held stuffed teddy bears and dogs. The smallest kids sat on their parents' laps.
There were tears and hugs, but also smiles and squeezed arms. Mixed with disbelief was a sense of a community reacquainting itself all at once. One man said it was less mournful, more familial. Some kids chatted easily with their friends. The adults embraced each other in support.
The president first met privately with families of the victims and with the emergency personnel who responded to the shootings. That meeting happened at Newtown High School, the site of Sunday night's interfaith vigil, about a mile and a half from where the shootings took place.
"We're halfway between grief and hope," said Curt Brantl, whose fourth-grade daughter was in the library of the elementary school when the shootings occurred. She was not harmed.
Police and firefighters got hugs and standing ovations when they entered. So did Obama.
"We needed this," said the Rev. Matt Crebbin, senior minister of the Newtown Congregational Church. "We need to be together here in this room. ... We needed to be together to show that we are together and united."
The shootings have restarted a debate in Washington about what politicians can to do help - gun control or otherwise. Obama on Friday called for leaders to agree on "meaningful action" to prevent killings.
Police say the gunman, Adam Lanza, was carrying an arsenal of ammunition big enough to kill just about every student in the school if given enough time. He shot himself in the head just as he heard police drawing near, authorities said.
A Connecticut official said the gunman's mother was found dead in her pajamas in bed, shot four times in the head with a.22-caliber rifle. The killer then went to the school with guns he took from his mother and began blasting his way through the building.
The tragedy plunged the picturesque New England town of 27,000 people into mourning.
"I know that Newtown will prevail, that we will not fall to acts of violence," said First Selectwoman Patricia Llodra. "It is a defining moment for our town, but it does not define us."
A White House official said Obama mainly wrote the speech himself. He worked with presidential speechwriter Cody Keenan, who helped Obama write his speech last year after shootings in Tucson, Ariz., left six dead and 13 wounded, including Rep. Gabby Giffords.
Just this past summer, Obama went to Aurora, Colo., to visit victims and families after a shooting spree at a movie theater in the Denver suburb left 12 dead.
In November 2009, Obama traveled to Fort Hood, Texas, to speak at the memorial service for 13 service members who were killed on the post by another soldier.
After the Colorado shooting in July, the White House made clear that Obama would not propose new gun restrictions in an election year and said he favored better enforcement of existing laws.