Obama said he would convene a meeting of law enforcers, parents, educators and others in an effort to prevent future tragedies, but he did not call for tougher gun laws.
"Are we really prepared to say we are powerless in the face of this carnage?" he asked.
Parents and children filled the Newtown High School auditorium for the vigil. Some of the children clutched stuffed animals and Red Cross blankets issued to ward off the cold.
"I think it's a good thing. I think it'll help this town begin to heal," Curt Brantl, 47, said of Obama's visit before the president spoke.
"It's a sign of hope that the leader of our country comes here and shows support," said Brantl, whose daughter, Tess, 9, was at Sandy Hook during the shooting. "We're turning the corner, and there's a lot of hope now."
Picture of the Crime
While townspeople grieved, investigators examined forensic evidence and scoured the crime scene in a process likely to extend for weeks. Many more witnesses needed to be interviewed, possibly including children who survived the attack, state police Lieutenant Paul Vance said.
Some of the bodies have been turned over to families, he said.
"We have the best of the best working on this case. ... Our goal is to paint a complete picture so that we all know and the public knows exactly what happened here," Vance said.
Painting part of that picture, Connecticut Governor Dannel Malloy said the gunman shot his way through a school door "using several rounds" before beginning to kill adults and children inside, then killed himself as police closed in.
"He discharged to make an opening and then went through it, went to the first classroom ... went to the second classroom. We surmise that it was during the second classroom episode that he heard responders coming and apparently at that, decided to take his own life," Malloy said on the ABC show "This Week."
"This sick fellow, you know, clearly mentally ill, killed his mother, proceeded to go on and kill a great number of people," Malloy added.
Vance said Lanza's mother, Nancy Lanza - found dead on Friday at her home - was shot several times.
Townspeople and visitors took solace in church on Sunday. Mass at St. Rose Catholic church was packed. The priest's announcements included news that the Christmas pageant rehearsal would go on as planned, but without 6-year-old Olivia Engel, killed on Friday before she could play the role of an angel.
Memorials Draw Mourners
Makeshift memorials appeared in this affluent town of 27,000 people about 80 miles (130 km) from New York City. The largest, festooned with flowers and teddy bears, sat at the end of Dickenson Drive where Sandy Hook Elementary stands.
Residents and visitors streamed past a police roadblock to add to it. One woman knelt down and sobbed violently.
As children walked down the street in the rain, carrying their toys and signs, a man sat on the back of his parked car playing a mournful tune on a violin to accompany them.
"This is a time to come together," said Carina Bandhaver, 43, who lives in nearby Southbury.
The children who survived will not have to return to the scene of the massacre. They will attend classes at an unused school in a Connecticut town about 7 miles (11 km) away, school officials said. Classes elsewhere in the town will resume on Tuesday, except at Sandy Hook.
Several Democratic lawmakers called for a new push for U.S. gun restrictions on Sunday, including a ban on military-style assault weapons.
Senator Dianne Feinstein of California, the author of an assault-weapons ban that lapsed in 2004, said she would introduce new legislation this week.
Gun rights advocates have countered that Connecticut already has among the strictest gun laws in the nation.
Police were trying to establish the relationship between Adam Lanza, Nancy Lanza and the school, and whether the mother and her sons were frequent visitors to gun ranges, according to a law enforcement official briefed on the investigation.
In addition to the military-style Bushmaster assault rifle, a civilian version of the weapon used by U.S. forces in Afghanistan, police said Lanza carried Glock 10 mm and Sig Sauer 9 mm handguns into the school.
Nancy Lanza legally owned a Sig Sauer and a Glock, handguns commonly used by police, in addition to the long gun, according to law enforcement officials.
Lanza had struggled at times to fit into the community and his mother pulled him out of school for several years to home-school him, said Louise Tambascio, the owner of My Place Restaurant, where his mother was a long-time patron.