A troubled teen has confessed to gunning down 17 people at his former high school in Florida, court documents showed, as the FBI admitted it had received a tip-off about the 19-year-old gunman yet failed to stop him.
As Americans reeled from the country's worst school massacre since the horror at Sandy Hook six years ago, President Donald Trump suggested the root cause of the violence was a crisis of mental health — and defied calls to address gun control.
Terrified students hid in closets and under desks on Wednesday at Marjory Stoneman Douglas High School in Parkland, texting for help as the gunman, Nikolas Cruz, stalked the school with a semi-automatic AR-15 rifle.
Cruz has been charged with 17 counts of premeditated murder, appearing Thursday afternoon via video link before a judge who ordered him held without bond. More than a dozen other people were injured in the shooting spree.
"Today is a day of healing. Today is a day of mourning," Broward County Sheriff Scott Israel said.
After being read his legal rights, "Cruz stated that he was the gunman who entered the school campus armed with a AR-15 and began shooting students that he saw in the hallways and on the school grounds," court documents showed.
Cruz arrived at the school in an Uber at 2:19 pm, authorities said. Less than three minutes later, he started spraying multiple classrooms with bullets. At 2:28 pm, he left the campus, according to an official timeline.
Cruz told police that he discarded his rifle -- which he bought legally in Florida -- and tactical gear in order to blend in with the crowd so he could flee, the documents showed.
After the shooting, he stopped at a Wal-Mart and then McDonalds, Israel told reporters. He was detained 40 minutes later, after police identified him using school security camera footage.
In a somber televised address to the nation in response to the 18th school shooting so far this year, Trump vowed to make mental health a priority -- after tweeting about the "many signs" the gunman was "mentally disturbed" -- while avoiding any talk of gun curbs.
Earlier in the day, Trump had asserted that "neighbours and classmates knew he was a big problem. Must always report such instances to authorities, again and again!"
Expelled from school for disciplinary reasons, Cruz was known to be fixated on firearms -- and had reportedly been identified as a potential threat to his classmates.
But US authorities themselves were under scrutiny, after the FBI confirmed it was alerted last September to a message posted on YouTube, in which a user named Nikolas Cruz vowed: "I am going to be a professional school shooter."
In a statement, the FBI said it had carried out "database reviews and other checks" but was unable to identify the person who made the post.
A mugshot of Cruz depicts an ordinary-looking young man -- cleanly-cut chestnut hair, hazel eyes, his face speckled with freckles.
But the information emerging since his attack suggests there were red flags that should have set off danger alerts.
"I met him last year, he was in my class at the beginning of the year and when I first met him, I knew that something was off about him and he was kind of weird," Manolo Alvarez, 17, told AFP.
Fellow students knew he posted violent messages online, and on Thursday the Anti-Defamation League reported he was a member of a white supremacist group and had taken part in military-style training exercises.
Fifteen people were killed at the high school, and two later died in hospital.
One of those killed was Aaron Feis, a well-loved football coach in Parkland, a city of about 30,000 people located north of Miami where Trump was due to travel to meet the shocked community.
Many others were first-year students at the school like Gina Montalto, who was a member of the schools winter colour guard squad.
Thousands of people turned out at numerous vigils throughout the day. Officials released silver balloons in honour of the 17 victims.
"President Trump, please do something. Do something. Action. We need it now. These kids need safety now," an emotional Lori Alhadeff, whose daughter Alyssa was among the dead, told CNN.
Carly Novell, a senior at the school who survived the shooting, said politicians must do something about gun violence.
"I just want people to stop, like, talking about it and then not doing anything. People keep, like, saying your thoughts and prayers and all of these things, but it doesnt make a difference if nothing ever changes.