Correction: An earlier version of this article incorrectly reported that Nancy Lanza, the mother of gunman Adam Lanza, was a kindergarten teacher at Sandy Hook Elementary School in Newtown, Conn. That information was provided by law enforcement officials. On Saturday, officials said that Nancy Lanza, who was killed at her nearby home, had no connection to the school. An earlier version of this article also incorrectly said that many of the children killed were kindergartners. All were in the first grade. The article also incorrectly reported that Adam Lanza had left a Bushmaster rifle in a car parked outside the school. In fact, he used the rifle to carry out the shootings. The information was provided by law enforcement sources speaking on the condition of anonymity because the investigation was in its initial stages.

This time, the shooter killed 27 people, including his elementary-schoolteacher mother, her principal and 20 children, most of them kindergartners. Then the shooter killed himself.

Friday morning’s massacre in Newtown, Conn. — the second-deadliest shooting event in U.S. history — took place at Sandy Hook Elementary School, where more than 600 children from kindergarten through fourth grade spend their days. About 9:30 a.m., the day was interrupted by a burst of sound on the school intercom: screams.

That was enough for some teachers to move their students away from doors and windows. In one room, a teacher locked her students in a closet, a move parents said saved their children’s lives. In another class, a teacher heard two blasts and ordered students into a corner.

Jessica Eisele, a fourth-grader at Sandy Hook, was in the gym when the shooting began. “On the loudspeaker, there was screaming and crying and she heard gunshots and then silence,” said her brother Nick, 15.

A janitor ran through the halls, shouting that a gunman was in the building. Witnesses heard dozens of pops coming from two classrooms and a hallway.

In the main office, the principal, vice principal and school psychologist heard the noise and stepped into the hall to investigate. A witness told CNN that the vice principal crawled back into the office after being shot in the foot. The principal and psychologist were later found dead.

Around Newtown, word spread by text, phone and the sound of dozens of emergency vehicles thundering toward the school. At Berkshire Motors, owner Jim Marcucilli thought he saw 40 police cruisers speed by. He had been working on a car, but its owner, frantic, demanded her keys back. “Oh, my God,” she said, “I have to get my kid.”

Joseph Wasik, 42, wasn’t too worried when his wife, Lynn, called to say she had received a text alert from the school. Like schools nationwide, Sandy Hook had been on lockdown before, always for events that turned out to be nothing. Earlier this year, reports of a loose bear seen in town had activated the system.

But when Wasik flipped open his laptop and saw a report of a school shooting, he got in his car and headed to Sandy Hook, where his daughter Alexis is a third-grader. “I flew down there,” said Wasik, an electrician.

When he arrived, the backup of emergency vehicles and panicked parents extended half a mile beyond the school. Wasik parked on the first lawn he could find and ran.

“It was chaos, cars blocking everything, a SWAT team,” he said. “All these parents screaming for their kids.”

Children were ushered out of the building, instructed to close their eyes as adults guided them through the halls. Some were so scared they vomited.

The students were moved into the parking lot, single file, hands on one another’s shoulders. Some wept, some smiled, some stared at the pavement.

A few of the children had blood on their clothes.

Helicopters circled above and dozens of emergency vehicles arrived from nearby towns. Firefighters rushed over to parents holding children and wrapped them in blankets to warm them from the December chill.

In a first-grade classroom, a boy, seeing that his teacher had been shot, bolted out the back door and kept running, friends said. The boy ended up on Church Hill Road, half a mile away, where a man picked him up and took him to the firehouse where other students were gathered.

Stephen Delgiadice’s 8-year-old daughter cowered with her classmates in a corner of their room until police led them out. “It’s alarming, especially in Newtown, Connecticut, which we always thought was the safest place in America,” he told the Associated Press. His daughter was unharmed.

Law enforcement sources identified the shooter as Adam Lanza, 20, the son of Nancy Lanza, whose body was found at the Newtown home she shared with Adam.

Authorities earlier Friday had misidentified the gunman as Ryan Lanza, Adam’s older brother. Ryan Lanza was questioned by police, who concluded that he had no connection to the massacre. Ryan said he had not been in contact with his brother for more than two years.

Reached at her home in Florida, Nancy Lanza’s mother said she could not fathom the violence that took her daughter’s life. “I just can’t cope with it right now,” Dorothy Hanson said through tears. “She was my daughter and a beautiful girl and I loved her. I just can’t make any more comments than that right now.”

Adam Lanza was unusually prone to tantrums as a child and took medication for behavioral issues, according to friends and neighbors of the family. Nancy and Peter Lanza separated about 10 years ago and divorced in 2009. Nancy remained in Newtown, and Peter, who remarried, lives in Stamford, Conn., friends said.

Once again, flags were lowered to half-mast across the land. In a television address, President Obama said that “as a nation, we have been through this too many times.” He broke off and took a long breath to suppress a sob. He wiped his eyes and pushed ahead. “These children are our children.”

Along with many other politicians, he pledged “meaningful action to prevent more tragedies like this,” but did not offer specifics. White House spokesman Jay Carney said Friday was a day “to feel enormous sympathy for families that are affected and to do everything we can to support state and local law enforcement. . . . I’m sure [there] will be a day for discussion of the usual Washington policy debates, but I don’t think today is that day.”

The death toll in Newtown is second only to that of the Virginia Tech shootings in 2007, in which 32 were killed. The massacre at Sandy Hook occurred five months after a gunman in Colorado killed 12 people in a movie theater where the Batman movie “The Dark Knight Rises” was opening, and two years after a shooter in Tucson killed six people and injured 13, including then-Rep. Gabrielle Giffords (D-Ariz.).

Newtown, a town of 28,000 eight miles outside Danbury and an hour’s drive northeast of New York City, is an affluent community with good schools and a population dominated by college graduates. Sandy Hook is a well-regarded school; year after year, its students score far higher than the state average on standardized tests.

Sandy Hook’s principal, Dawn Hochsprung, had recently installed a new security system in which the school doors were kept locked all day starting at 9:30 a.m.

Some parents said the shooter probably was able to walk in unquestioned because school employees knew he was a teacher’s son. Adam Lanza arrived at Sandy Hook in his mother’s car, law enforcement sources said.

Hochsprung, known for her infectious laugh, dressed up last month as the Book Fairy — replete with light-up dress and crown — to inspire children to read. Hochsprung, who was married and had two daughters and three stepdaughters, wrote on Twitter on Wednesday that her students were “enjoying the rehearsal for our 4th grade winter concert.”

Police found three firearms: two handguns, a Sig Sauer and a Glock, and a .223 Bushmaster brand rifle. A law enforcement official said the weapons were obtained legally and were registered to a family member.

After police determined that the shooter was not at large, the students were taken to a nearby firehouse, where they sat with classmates as teachers wrote up a list of everyone who was there. Parents, many of them sobbing, arrived to reunite with their children.

“It was elbow-to-elbow people crying,” Wasik said. “No one could tell you where to go. People were screaming, ‘Please say it’s not mine, please say it’s not mine.’ ”

The parents who could not find their children’s names on the list gathered in another room, where Gov. Dan Malloy (D) visited them, bringing bits of news, none of it good.

Wasik ran into a friend, Steve, the father of a first-grader.

“Steve,” Wasik recalled saying, “you find your kid?”

“No, I haven’t found my son,” the distraught man replied. “Nobody knows where he is. Where is he? Where is he?”

Wasik moved on, the dread and primal panic mounting until finally, 20 minutes after he ditched his car, he caught sight of his daughter.

The relief was disorienting. He tried to comfort his child, call his wife and text his parents. His wife arrived and the three of them huddled with Alexis.

His daughter “was a wreck,” Wasik said. “She saw some things.”

The family plans to get out of town while they figure out how to explain the unexplainable to a third-grader.

“I don’t see her ever going back to that school,” Wasik said.

When the Wasiks were allowed to leave the firehouse, they saw their friend Steve again. He was with his wife and a police officer.

“We found out later,” Wasik said. “They lost their child. He was in the first grade.”

After dark, much of Newtown gathered at St. Rose of Lima Church for a memorial mass. Hundreds who could not fit in the church stood outside; several dozen formed a circle, holding hands, and sang “Silent Night.”

Tim Cervera, 13, a student at Newtown Middle School, went to the church because his neighbor, a young girl, was killed. “I was scared that they would come get us at our middle school,” Tim said.

Ray Horvath, a bear of a man, leaned against a tree in tears. A teacher at Sandy Hook, he recalled one of the children who had been killed. “He was a total pain in the ass, but we loved him,” he said. Horvath said he left school on Friday morning five minutes before the shooting began, and then he stopped: “I can’t say any more.”

Fisher and Hendrix reported from Washington. Brady Dennis, Sari Horwitz, Greg Jaffe and Paul Schwartzman in Washington and Colum Lynch and special correspondent Alison Griswold in Newtown contributed to this report.