The suspect in a deadly rampage at a Florida high school is a troubled teenager who posted disturbing material on social media before the shooting spree that killed at least 17 people, according to a law enforcement official and former schoolmates.
Broward County Sheriff Scott Israel said the 19-year-old suspect, Nikolas Cruz, had been expelled from Marjory Stoneman Douglas High School for "disciplinary reasons".
"I don't know the specifics," the sheriff said.
However, Victoria Olvera, a 17-year-old junior, said Mr Cruz was expelled last school year after a fight with his former girlfriend's new boyfriend. She said Mr Cruz had been abusive to his girlfriend.
School officials said Mr Cruz was attending another school in Broward County after his expulsion.
Broward County Mayor Beam Furr said during an interview with CNN that the shooter was getting treatment at a mental health clinic for a while, but that he had not been back to the clinic for more than a year.
"It wasn't like there wasn't concern for him," Mayor Furr said.
"We try to keep our eyes out on those kids who aren't connected ... Most teachers try to steer them toward some kind of connections. ... In this case, we didn't find a way to connect with this kid," Mayor Furr said.
Investigators were dissecting the suspect's social media posts.
"And some of the things that have come to mind are very, very disturbing," said Broward County Sheriff Scott Israel.
Daniel Huerfano, a student who fled Wednesday's attack, said he recognised Mr Cruz from an Instagram photo in which Mr Cruz posed with a gun in front of his face. Huerfano recalled Cruz as a shy student and remembered seeing him walking around with his lunch bag.
"He was that weird kid that you see ... like a loner," he added.
Dakota Mutchler, a 17-year-old junior, said he used to be close friends with Mr Cruz but had not seen him in more than a year following his expulsion from school.
"He started progressively getting a little more weird," Mutchler said.
Mutchler recalled Mr Cruz posting on Instagram about killing animals and said he had talked about doing target practice in his backyard with a pellet gun.
"He started going after one of my friends, threatening her, and I cut him off from there," Mutchler said.
"I think everyone had in their minds if anybody was going to do it, it was going to be him," Mutchler said.
Broward County School District Superintendent Robert Runcie told reporters on Wednesday afternoon that he did not know of any threats posed by Mr Cruz to the school.
"Typically you see in these situations that there potentially could have been signs out there," Mr Runcie said. "I would be speculating at this point if there were, but we didn't have any warnings. There weren't any phone calls or threats that we know of that were made."
However, a teacher told The Miami Herald that Mr Cruz may have been identified as a potential threat to other students. Jim Gard, a maths teacher who said Mr Cruz had been in his class last year, said he believes the school had sent out an email warning teachers that Mr Cruz should not be allowed on campus with a backpack.
"There were problems with him last year threatening students, and I guess he was asked to leave campus," Mr Gard said.