The FBI has launched a review over its handling of a warning about the teenager accused of carrying out Wednesday's school shooting in Florida.
Nikolas Cruz, 19, has appeared in court charged with premeditated murder. With 17 people killed, this is the deadliest US school shooting since 2012.
Mr Cruz reportedly commented on a YouTube post last year that he would be a "professional school shooter".
The FBI admitted that a user had alerted authorities to the post.
Teachers were also warned about Mr Cruz, who was not allowed on campus with a backpack, US media report.
The FBI said it had investigated the YouTube comment but had been unable to fully identify the person who posted it.
The attack happened at Marjory Stoneman Douglas High School in Parkland, Florida. Fourteen people were wounded, three of whom remain in a critical condition.
On Thursday, Mr Cruz confessed to investigators that he carried out the shooting, adding that he had a backpack full of ammunition.
Expressing his condolences earlier, US President Donald Trump said he was "making plans to visit" Parkland.
What were the warnings?
After seeing a comment on a YouTube post last year by Mr Cruz, user Ben Bennight contacted the FBI and spoke to representatives for about 20 minutes.
Mr Bennight said the FBI contacted him again following the school shooting in Parkland.
The FBI confirmed on Thursday that they were made aware of the comment, adding that they had conducted "checks" but were unable to identify the person behind it.
Meanwhile maths teacher Jim Gard told the Miami Herald newspaper that school authorities had emailed teachers about Mr Cruz's behaviour.
"We were told last year that he wasn't allowed on campus with a backpack on him," Mr Gard told the Miami Herald.
"There were problems with him last year threatening students, and I guess he was asked to leave campus."
It is unclear why Mr Cruz was expelled from the school. Former schoolmate Joshua Charo said Mr Cruz had been found with bullets in his backpack.
"I can't say I was shocked," Mr Charo said after the shooting.
"He seemed like the kind of kid who would do something like this."
Other students echoed that opinion. "Everyone predicted it," one told local station WFOR.
But police said they had not been warned of a possible attack by Mr Cruz.
What else do we know about the suspect?
US media quote the head of white supremacist group the Republic of Florida Jordan Jereb as saying Mr Cruz had once trained with them, but the group had not wanted or ordered him to carry out a school shooting.
However local media later reported that investigators had been unable to find any link between Mr Cruz and the ROF.
Broward County Sheriff Scott Israel said Mr Cruz's social media profiles were "very, very disturbing".
Two separate Instagram accounts, now deleted, purport to show Mr Cruz posing with guns and knives.
Mr Cruz allegedly used an AR-15 rifle in the attack, which he had reportedly bought legally.
Who were the victims?
Details of the 17 victims are emerging.
The school's assistant football coach Aaron Feis was taken to hospital after jumping in front of students to shield them from bullets. His team tweeted that he had "died a hero".
It is with Great sadness that our Football Family has learned about the death of Aaron Feis. He was our Assistant Football Coach and security guard. He selflessly shielded students from the shooter when he was shot. He died a hero and he will forever be in our hearts and memories pic.twitter.com/O181FvuHl3— MS Douglas Football (@MSDEagles) February 15, 2018
Chris Hixon, who was the athletic director at the school, was also confirmed dead by local media. In 2007 Mr Hixon, 49, served as a US Naval Reservist in Iraq.
Teacher Scott Beigel died while trying to lock the door, a student told Good Morning America.
Among the student victims so far identified are:
- Alaina Petty, 14
- Alex Schachter, 14
- Martin Duque, 14
- Gina Montalto, 14
- Jaime Guttenberg, 17
- Cara Loughran
- Luke Hoyer, 15
- Alyssa Alhadeff, 15
- Carmen Schentrup, 16
- Joaquin Oliver, 17
- Nicholas Dworet, 18
- Meadow Pollack, 18
What's the reaction been?
Speaking at the White House on Thursday, Mr Trump addressed "every parent, teacher and child who is hurting", and said authorities would do "whatever we can to ease your pain".
"I want you to know that you are never alone," the president said, adding: "No child should be in danger in an American school."
He added: "We are committed to working with local leaders to tackle the difficult issue of mental health.".
Mr Trump earlier said the shooting showed that people must report their concerns about others' erratic behaviour.
So many signs that the Florida shooter was mentally disturbed, even expelled from school for bad and erratic behavior. Neighbors and classmates knew he was a big problem. Must always report such instances to authorities, again and again!— Donald J. Trump (@realDonaldTrump) February 15, 2018
Florida Senator Marco Rubio tweeted that the shooting was "designed and executed to maximize loss of life".
Just finished update from fed authorities on #FloridaSchoolShooting. It is clear attack was designed & executed to maximize loss of life— Marco Rubio (@marcorubio) February 15, 2018
But he said that it was too soon to debate whether tighter gun laws could have stopped it.
"You should know the facts of that incident before you run out and prescribe some law that you claim could have prevented it," he told Fox News.
Florida Governor Rick Scott said the shooting was "pure evil", but also refused to be drawn into a discussion about gun control.
Florida's Democratic Senator Bill Nelson asked what it would take "for enough to be enough".
Democratic Senator Chris Murphy tweeted that it was time to debate gun violence, adding that political leaders needed to act to prevent "this slaughter".