The gunman who killed 20 children and six adults at a Connecticut elementary school first murdered his mother at home before embarking on the shooting rampage.

Law enforcement officials identified the shooter as 20-year-old Adam Lanza, who opened fire inside the Sandy Hook Elementary School on Friday morning before turning a gun on himself, bringing the death toll to 28.

The guns he used were legally purchased and registered to his mother, Nancy Lanza.

Earlier Friday, the shooter was mistakenly identified as Lanza’s older brother, Ryan Lanza, because his identification was found on the killer’s body.

Ryan, 24, who lives in New Jersey, was questioned by police, but authorities said they don’t believe he had any involvement in the shooting. Ryan reportedly told police that he hasn’t been in contact with his brother since 2010.

The massacre was one of the worst mass school shootings in U.S. history, behind the Virginia Tech university massacre in 2007 that left 32 people dead.

“I know there is not a parent in America who doesn’t feel the same overwhelming grief that I do,” President Barack Obama said, wiping tears from his eyes as he addressed the nation hours after the shooting. “(These were) beautiful little kids between the ages of five and 10 years old. They had their entire lives ahead of them: birthdays, graduations, weddings, kids of their own.”

“Our hearts are broken today for the parents and grandparents, sisters and brothers of these little children and for the families of the adults who were lost.”

Police in Newtown, Conn, a quiet town about an hour’s drive north of New York City, were alerted to the shooting at Sandy Hook Elementary School around 9:40 a.m. ET. They contacted Connecticut State Police and surrounding police departments. A SWAT team also rushed to the school.

“Our main objective was to evacuate all students and faculty from the school,” Connecticut State Police Lt. Paul Vance told reporters.

He said police “searched every nook and cranny” to safely get survivors out of the building, describing the scene inside as “horrific.”

Vance said 18 children and six adults were pronounced dead at the scene. Two children died later in hospital. One female employee of the school was injured.

Vance said police and the medical investigator are still working to positively identify all the victims, although parents of the murdered children have all been notified.

Vance said the shooting occurred in two classrooms contained in one section of the school. Two weapons were seized at the scene, and police later found more guns inside the school.

“We will leave no stone unturned,” Vance said of the multi-force investigation.

About 626 students from Kindergarten through Grade 4 attend Sandy Hook public school, which is located in one of the wealthiest counties in the U.S.

Photos from the scene showed crying and frightened students being escorted through the school parking lot.

One young student told CNN that he heard "lots of banging" before a police officer busted into his classroom.

"We heard screaming ... so we went to the wall and sat down and then a police came in and was like, 'Is he in here?' and he ran out. Then someone yelled 'get to a safe place' so we went to a closet in the gym and sat there for a while."

Another eight-year-old student at the school told WCBS-TV's he was on the way to the school's office when he heard shots.

"I saw some of the bullets going down the hall that I was right next to and then a teacher pulled me into her classroom," he said.

Stephen Delgiadice, whose eight-year-old daughter attends the school, says his child heard two big bangs and teachers told her to get in a corner. She was later evacuated from the school unharmed.

"It's alarming, especially in Newtown, Connecticut, which we always thought was the safest place in America," he told AP.

Richard Wilford said his seven-year-old son, Richie, heard a noise that "sounded like what he described as cans falling." The boy told him a teacher went out to check on the noise, came back in, locked the door and had the kids huddle up in the corner until police arrived.

"There's no words," Wilford said. "It's sheer terror, a sense of imminent danger, to get to your child and be there to protect him."

Other parents said they found chaos when they arrived on the scene.

"It was horrendous," parent Brenda Lebinski, whose daughter is in Grade 3, told Reuters.

"Everyone was in hysterics: parents, students. There were kids coming out of the school bloodied. I don't know if they were shot, but they were bloodied."

Visitors to Sandy Hook’s website Friday afternoon were directed to a separate page that advertised a memorial mass for the victims and their families at St. Rose Church in Newtown.

Vance said every family that lost a child or a relative in the shooting has been assigned a state trooper who will keep them abreast of the police investigation. Counsellors have also been summoned to offer support to both the victims’ families and the first responders who witnessed the shooting’s bloody aftermath.

“Evil visited this community today,” Connecticut Gov. Dan Malloy told reporters Friday evening. He said “it’s too early to speak of recovery,” but wanted the affected families to know “that we’re all in this together.”

In Canada, Prime Minister Stephen Harper reached out to the affected families on Twitter minutes after finding out about the shooting.

“The news is just awful. The thoughts and prayers of Canadians are with the students and families in Connecticut affected by this senseless violence,” he tweeted.

The public shooting is one of several that have already occurred in the U.S. this year. In July, a gunman killed 12 people at a Colorado movie theatre, and in August, six people were killed at a Sikh temple in Wisconsin before the gunman turned the weapon on himself. Earlier this week, a gunman opened fire at an Oregon mall, killing two people before turning the gun on himself.

With files from The Associated Press