Law-enforcement officials identified the suspected shooter as 20-year-old Adam Lanza and said he was found dead inside the school. Officials said the alleged shooter’s mother, Nancy Lanza, was believed to be among the victims.

Newtown High School Yearbook 2008

Adam Lanza in 2008, seen in a yearbook photo as a high-school sophomore in Newtown, Conn.

Earlier, a law-enforcement official incorrectly identified the suspect as 24-year-old Ryan Lanza, who is Adam’s brother. Ryan was questioned by investigators Friday but isn’t believed to have had any role in the shooting.

Two federal law-enforcement officials familiar with the investigation said the firearms recovered at the scene — Glock and Sig Sauer handguns – were registered to the alleged shooter’s mother and are legal. A third firearm was registered to Ms. Lanza as well, the officials said.

The registration answers one of the questions about the origin of the firearms believed used in the mass shooting. Under federal law, Adam Lanza would have been prohibited from buying handguns from a licensed dealer because of his age.

According to state court records, the suspected gunman’s parents divorced in 2009. Both Nancy and Peter Lanza filed certifications of their completion of a parenting-education program, a Connecticut state requirement in divorce proceedings if the couple has children under the age of 18.

Beth Israel, a neighbor of the Lanza family whose daughter went to elementary school with Adam, said she recalled the suspected gunman as a “socially awkward” teenager.

“He was kind of a loner and shy. He didn’t look you in the eye,” she said. Ms. Israel described Adam as very thin with dirty-blonde hair and a long, narrow face.

Mary Ann Lanza, the ex-wife of Adam Lanza’s grandfather, said she remembers the family as a close-knit and loving group who lived across New England, from New Hampshire to Connecticut. Adam’s aunt and uncle live in New Hampshire, she said, and would often invite relatives to swim in their above-ground pool during the summers.

“They were just a lovely family,” Mary Ann Lanza said.

His former grandmother said she remembered Adam as a young child but didn’t know him as a teenager. His parents had separated “years” before they divorced, she said.

Her ex-husband, who died in 2010, was a widower when she met him, with children and grandchildren of his own. They married in the 1990s and divorced in 2001, she said.

Mary Ann Lanza hadn’t realized until informed by a reporter of her family connection to the suspect in the mass shooting. “Oh my God, oh my God. Adam?” she said. “But they’re such a lovely family, the whole family was just beautiful.”

Katie Colaneri, a 24-year-old resident of Hoboken, N.J., described herself as a friend of Ryan, the suspect’s brother who for hours Friday was incorrectly identified as the alleged gunman. “He [is] a little shy, but very nice and sweet,” said Ms. Colaneri, who has known Ryan for over a year.

She said Ryan is a gentle guy who was devoted to his job at the Ernst & Young accounting firm. A representative for Ernst & Young would not comment on his employment status.

A law-enforcement official briefed on the investigation told the Associated Press that Ryan has been “extremely co-operative” and is not under arrest, although he was still being question late Friday.

The official said Ryan’s computers and phone records were being searched but only “in an abundance of caution.” Ryan told authorities he had not been in touch with his brother Adam in recent years, and the official said he isn’t believed to have any connection to the school killings.

In Hoboken, Ryan lives in a newer building that was hard-hit by superstorm Sandy, Ms. Colaneri said. He lost power for a number of days following the storm.

The last time she saw him, about a month ago, Ms. Colaneri recalled that Ryan ran up to her and gave her a hug. ”I’m really shocked,” she said. “As the details unfolded, I was totally devastated.”

The well-to-do suburban neighborhood where the Lanzas lived was lit up as on a usual December Friday night, with lavish Christmas lights covering the trees and plastic reindeer set on manicured lawns. Police blocked off the street as a crush of news vans lined up behind the police tape.

A neighbor of the Lanza family said that houses along Yogananda Street in the village of Sandy Hook occupy at least two acres of land. The home occupied by Nancy Lanza is a yellow Colonial with a swing set in the backyard, located in a wooded area at the end of a long, private road.

“I wouldn’t know them if they drove right by me,” he said of the family, describing them in a phone interview as a quiet presence in the neighborhood. “We know all the neighbors but them.”

The 49-year-old neighbor, who did not wish to be identified, said police surrounded the home on Friday afternoon and had forced open the garage door with a loud bang. He said police arrived before noon and were eventually joined by a heavily armed group of officers in “full camouflage.”

A former school board official in Newtown called into question earlier reports that Nancy Lanza had been connected to Sandy Hook Elementary School, possibly as part of the teaching staff.

“No one has heard of her,” said Lillian Bittman, who served on the local school board until 2011. “Teachers don’t know her.”