There had been warning signs that the 19-year-old former student who opened fire at the Florida high school, killing at least 17, had posed a threat, it has been reported.

Authorities identified the suspect as Nikolas Cruz, a former student who had been expelled from Marjory Stoneman Douglas High School for disciplinary reasons.

Some teachers told reporters that Cruz had been identified as a potential threat to fellow students in the past.

"We were told last year that he wasn't allowed on campus with a backpack on him," maths teacher Jim Gard told the Miami Herald. "There were problems with him last year threatening students, and I guess he was asked to leave campus."

The gunman is believed to have had one AR-15-style semiautomatic rifle and multiple magazines. It was not clear whether the suspect, who was taken into custody off campus, had any other weapons.

Broward County Sheriff Scott Israel said investigators were reviewing social media posts he described as "very disturbing". While federal and local authorities said there was no evidence that the suspect had an accomplice or accomplices.

Stoneman school shooting
Police escort a suspect into the Broward Jail after checking him at the hospital following a shooting incident at Marjory Stoneman Douglas High School in Parkland, Florida, US 14 February 2018 in a still image taken from a video WSVN.com via REUTERS

17 killed, 14 injured

The devastating shooting began around 2.30pm EST (7.30pm GMT) on Wednesday (14 February) as the fire alarm sounded. Sheriff Israel said he was "saddened" to confirm that 17 people were killed and at least 14 others were injured.

Gard told the Herald that six students ran into his classroom, where they remained during a lock down. "Six kids ran back into my room, and I locked the door, turned out the lights and had the kids go to the back of the room," he said. "Within a minute a code red was announced," Gard added, referring to the school's lock down code.

Heavily armed SWAT team members entered the school as students filed out with their hands up. Police conducted a class-by-class search to make sure there were "no other shooters" and to retrieve bodies, Superintendent Robert Runcie said.

A student spoke to WJXT and claimed "everyone predicted" Cruz would shoot up the school. "Honestly, a lot of people were saying it was gonna be him," the unnamed student told the news station. The student added that the gunman knew the layout of the school.

"Yeah, he was on the third floor. He knows the school layout, he knows where everyone would be at as of right now," he said. "He's been with us in fire drills, he's prepared for this stuff."

The gunman terrorised the school for more than an hour until authorities confirmed just after 4pm that he had been apprehended.

"This is a terrible day for Broward County, the state of Florida, the United States," Israel said. "There really are no words."

Survivors in shock

Parents described the shock and fear their children felt during the deadly ambush.

Joel Leffler, whose son and daughter are students at the school, said his children were in shock. "My son called me as it was unfolding, running. He had to jump a fence," he said. "My son heard around eight gun shots as he was running out."

Leffler said his daughter was whispering when he finally reached her on the phone. "My daughter, who was there in the freshman hall where the shooting took place — she's in shock right now, and she's being taken out by SWAT," he said. "She saw multiple dead bodies."

Stoneman school shooting
Students react following a shooting at Marjory Stoneman Douglas High School in Parkland, Florida, a city about 50 miles (80 kilometers) north of Miami on 14 February 2018 AFP PHOTO / Michele Eve Sandberg

Parents looking for their children were urged to go to the Marriot in Coral Springs. The school will be closed for the rest of the week, the Broward School District announced.

The FBI's Miami Division and the Miami Division of the federal Bureau of Alcohol, Tobacco, Firearms and Explosives sent agents to the scene of the shooting.