NEWTOWN, Conn. — Twenty children, some as young as 5 years old, were killed Friday morning in a gunman’s rampage at a southwestern ­Connecticut elementary school, a massacre that made real every parent’s darkest fear.

A 20-year-old Newtown man, identified by law enforcement sources as Adam Lanza, entered Sandy Hook Elementary School in Newtown around 9:30 a.m., armed for a slaughter with at least two handguns. A total of 28 people, including the shooter and his mother, were killed in the day’s violence.

Lanza shot children in two classrooms and killed six adults in one of the deadli­est mass shootings in US history. He then took his own life. Earlier, he killed his mother, Nancy Lanza, at their home in ­Newtown, the Associated Press reported.

The killing of so many, so young, shook the nation and thrust a rural suburb of 27,000 people — 60 miles from New York and 2½ hours from Boston — into the grim company of ­Littleton, Colo., site of the 1999 Columbine massacre, and the Blacksburg campus of Virginia Tech, where a gunman killed 32 in 2007.

Get Fast Forward in your inbox:

Forget yesterday's news. Get what you need today in this early-morning email.

“There’s a feeling of isolation from tragedies like this, in this place,” said James ­Dietter, 26, a Newtown native, who attended Sandy Hook ­Elementary as a child. “I’m coming to terms with the fact that this is gone. And this tragedy will define this town from now on.”

A tearful President Obama offered condolences to a ­nation anguished by another mass shooting, as he has done each time after the 2009 ­attack at Fort Hood, Texas, which killed 13; the 2011 assas­sination attempt on US Representative Gabrielle ­Giffords, which killed six; and last July’s cinema shootings in Aurora, Colo., which killed 12.

“The majority of those who died today were children. beautiful little kids between the ages of 5 and 10 years old,” said the president, who paused and struggled to get through his short statement at the White House. “I know there’s not a parent in America who doesn’t feel the same overwhelming grief that I do.”

The president, who has not made gun control a central part of his agenda, suggested that may now change. “We’re going to have to come together and take meaningful action to prevent more tragedies like this, regardless of the politics,” he said.

Adrees Latif/Reuters

Families of victims grieved in the aftermath of the shootings.

In Newtown, Governor Dannel P. Malloy of Connecticut met privately with parents who had sent their children to school in the morning, never to see them again.

“Evil visited this community today,” the governor told ­reporters. “And it’s too early to speak of recovery, but each parent, each sibling, each member of the family has to understand that Connecticut — we’re all in this together. We’ll do whatever we can to overcome this event.”

Details on the shooter and how he carried out the crime were slow to emerge Friday night.

Police offered no theory for what might have motivated the attack. The Associated Press reported that Lanza’s brother, Ryan, 24, who was mistakenly reported by some news agencies as the shooter on Friday, was cooperating with police.

Adam Lanza was born in Kingston, N.H., just north of Haverhill, Mass.

Law enforcement officials told the New York Times that Lanza had grown up in ­Newtown, and he was remembered by high school classmates as smart, introverted, and nervous. Some said they believed he suffered from Asperger’s syndrome.

James Champion, Lanza’s uncle, stood outside his home in Kingston Friday night and said he still did not know what had happened in ­Newtown and did not want to comment. Champion is the brother of Lanza’s mother.

Ken and Donna Kowalski, neighbors to the school serving kindergarten through-fourth grade in the village of Sandy Hook, said in an interview that they heard shots, a dozen or so, and within seconds the school’s fire alarm went off.

Then the police arrived, blaring sirens from what seemed like every direction.

“Minutes after that, parents’ cars came flying down the road,” said Ken. “Some parked in the middle of the street.”

Terrified parents ran ­toward the school.

Susan Harris, 61, said her sister, Barbara Halstead, a secretary at the main office at the elementary school, “made a number of calls over the loudspeaker warning everyone.” Halstead and a school nurse then hid from the shooter in a closet, she said.

A 9-year-old student told The New York Times he was in the gymnasium when he heard “really loud bangs.’’

Jessica Hill/Associated Press

A distraught woman waited to find out information about her sister, a teacher at the school.

The boy, speaking with his father at his side outside the school, said, “We thought that someone was knocking something over. And we heard yelling, and we heard gunshots. We heard lots of gunshots. We heard someone say, ‘Put your hands up.’ I heard, ‘Don’t shoot.’ We had to go into the closet in the gym. Then someone came and told us to run down the hallway. There were police at every door. There were lots of people crying and screaming.’’

Witnesses reported that 100 rounds may have been fired.

Police arrived to find “a tragic, horrific scene” of murdered children in their classrooms, Connecticut State ­Police Lieutenant Paul Vance said in a briefing for reporters.

Eighteen children were found dead in the school. Two who had been wounded died later in hospitals. Only one person wounded in the attack survived, police said.

Heavily armed officers spent hours searching cars and homes, even the school roof, looking for evidence or for additional gunmen. The AP reported that police recovered three guns from the school grounds, including a ­rifle found in a car.

Teachers and school staff evacuated students, many without their coats, to a nearby firehouse. Authorities contacted parents through an electronic notification system, and then began the excruciating task of accounting for each of nearly 700 children who attend the school, including those who might have been home sick.

Joe Wasik, 42, a Newtown resident, said his wife called him at work around 10 a.m., saying she had received an alert about an emergency at the school where their daughter, Alexis, is a student.

Wasik sped to the firehouse. “I just wanted my daughter.”

Inside the firehouse, children were grouped by age. “There were so many people, everyone was looking for their kids,” he said. “It was pandemonium.”

His daughter cried when he hugged her. She told Wasik that a teacher had hidden her class in a closet.

Some of the parents who had lost children stayed well after dark at the firehouse, police said. The Rev. Robert Weiss, pastor of St. Rose of ­Lima Church, spent the day with the families, including members of his church, who would come to worship with “beautiful little children. . . . I’ve watched them grow.”

Michelle McLoughlin/Reuters

Children huddled in the aftermath of the shootings.

He struggled to describe the scene: “There’s no words. There’s been a lot of hugging and crying and sharing memories. Many parents came in with pictures of their children. The feeling will be there for a long time.”

The tragedy dwarfed the nation’s political problems, at least for the moment. House Speaker John A. Boehner, who has been battling the president over taxes and spending, canceled the traditional weekly GOP radio address, “so that President Obama can speak for the entire nation at this time of mourning,” Boehner said in a statement.

In Newtown on Friday evening, families gathered for a vigil at St. Rose of Lima.

“My grandson is 6, so this hits home,” said George ­Reichert, 64, attending with his wife, Michelle. “We don’t know anyone personally, but we do know them: they’re our neighbors. We see them around town, at the supermarket, at the coffee shops.”

Rob Cox said he grew up in Newtown. His family lived in Europe but moved back to Newtown because he wanted a safe community with great schools.

“There are no big losses in our immediate circle, thank God,” Cox said. “But these are all our kids. These are ­Newtown’s kids. We claim them.”

Globe correspondents Zachary T. Sampson, Matt Rocheleau, Jaclyn Reiss, Derek J. Anderson, and Melanie Dostis contributed to this report, Rocheleau and Reiss from Connecticut and Sampson from New Hampshire. The article was written by Mark Arsenault in Boston. He can be reached at marsenault@globe.com.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.