NEW YORK - At least 27 people including 18 children were killed in a shooting Friday at a Connecticut elementary school, US media reported, citing law enforcement officials.

The gunman who slaughtered staff and children at the Sandy Hook Elementary School in Newtown was reported to be 24-year-old Ryan Lanza, who also killed his parents, school principal and a teacher, before he was killed by police.

It is highest number of deaths in a series of recent gun massacres to rock America, and after the shooting President Obama directed to half staff the US flags.

Lanza killed his father at home before driving to the school and killing his mother, who worked there, along with many of her young students. Police did not immediately confirm details of the attack.

The principal and school psychologist were among the dead, CNN said, while police said the shooter was killed in police action. The suspected shooter was armed with four weapons and wearing a bullet-proof vest, WABC reported.

Three people were taken to Danbury Hospital, about 11 miles west of the school, a hospital spokeswoman told NBC Connecticut. The mayor of Danbury, Mark Boughton, told MSNBC: “They are very serious injuries.” Witnesses reported hearing dozens of shots with some saying as many as 100 were fired.

Another person was being held in police custody after he was detained in the woods near the school wearing camouflage pants, CBS reported. The school teaches children from kindergarten through fourth grade – roughly ages 5 to 10.

Lebinski, a mother of a school child, said that another mother who was at the school during the shooting told her a “masked man” entered the principal’s office and may have shot the principal. Lebinski said she learnt that the principal was “severely injured”. She said her daughter’s teacher “immediately locked the door to the classroom and put all the kids in the corner of the room”.

Connecticut State Police spokesman Lieutenant Paul Vance could not confirm the death toll, but said there had been ‘several fatalities’ among staff and students. He said that the shooter had died within the building during the police operation, and that the scene was secure and the public safe, but gave few details of the latest in a series of recent gun massacres to rock America.

If confirmed, the toll would be the highest death toll in a US school shooting, exceeding the 15 killed in the 1999 Columbine High School massacre which triggered a fierce but inconclusive debate about the United States’ liberal gun control laws.

“I was in the gym at the time ... we heard lots of bangs, and we thought that it was the custodian knocking stuff down. We heard screaming. And so went to the wall, and we sat down,” a young boy told WCBS television.

“Then the police came in. It’s like, is he in here? Then he ran out ,” he said, as stunned parents arrived.

“Then the police like were knocking on the door, and they’re like, we’re evacuating people, we’re evacuating people. We ran out. “They’re police at every door leading us down this way, this way. Quick, quick, come on. We ran down to the firehouse. There’s a man that pinned down to the ground with handcuffs on,” he said.

Police swarmed into the leafy neighborhood after the shooting, while other area schools were put under lock-down, police and local media said. The Newtown Bee newspaper said that a child was carried out of the school with apparently serious injuries.