A grimly familiar picture is building of the suspect in America's latest mass shooting as a depressed loner with a fixation on violence and weapons.
One student at Marjory Stoneman Douglas High School in Parkland, Florida, said that many pupils had previously joked Nikolas Cruz, 19, would be "the one to shoot up the school".
The orphan was expelled for disciplinary reasons from the high school he has now confessed to attacking.
Mr Cruz admitted he had carried out the attack, even after learning that his admission could incriminate him, according to police documents.
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."
He added that the school had sent out an email warning teachers about Mr Cruz's threats.
Mr Gard said the suspect was so obsessed with one girl at the school it approached "the point of stalking her".
Eddie Bonilla, a former classmate, told local media that many students predicted Mr Cruz was behind the shooting.
"We actually, a lot of kids threw jokes around like that, saying that he's the one to shoot up the school, but it turns out everyone predicted it. It's crazy," he told a local CBS affiliate.
Chad Williams, 18, told Reuters news agency Mr Cruz was "crazy about guns" and would regularly set off the fire alarm before he was eventually thrown out of the school for fighting.
"He was kind of an outcast. He didn't have many friends," he said.
Another former schoolmate, Joshua Charo, said bullets had been found in Mr Cruz's backpack.
Knives and guns feature in images taken from now-deleted Instagram accounts that apparently belonged to Mr Cruz.
One picture shows a box of ammunition and another rifles on a bed.
In several images a masked man is shown holding up large knives to the camera.
One of the Instagram accounts shows Mr Cruz wearing a Make America Great Again hat - worn by supporters of President Donald Trump - with a red, white and blue bandana masking his face, according to CBS News.
Two students also told the Daily Beast website that the suspect was previously seen wearing the hat at school.
The mayor of Broward County, Mayor Beam Furr, told CNN that Mr Cruz had sought treatment at a mental health facility over a year ago.
The suspect allegedly carried out the massacre with an AR-15 that he had legally bought.
Shelby Speno, who once lived near the suspect, told the Orlando Sentinel that "creepy" Mr Cruz was a known local troublemaker.
She said he had shot at a householder's chickens, bitten a child, stole residents' post and threw eggs at her car while she was driving.
Police were called out a number of times because of his anti-social behaviour, she said.
"That child had an extremely cold stare," former neighbour Rhonda Roxburgh, 45, told the Miami Herald.
"He was going to hurt somebody. I just didn't know it would be this bad."
Mr Cruz was adopted at a young age.
The suspect's adoptive father Roger Cruz died of a heart attack several years ago. His adoptive mother, Lynda Cruz, passed away of pneumonia in November last year.
After briefly staying with his half-brother at the home of relatives, the suspect moved in with a school friend's family.
Jim Lewis, the family's lawyer, told WPTV: "They are heartbroken. The kid that lives here goes to that school and knows many of these kids.
"He is just as heartbroken and shocked as everyone else."
He said the family saw no sign the suspect was planning an attack in the 90 days he lived with them.
Mr Lewis said the suspect owned an AR-15 rifle, which the family insisted he keep locked in a cabinet.
But the suspect did have the key to access it, according to the attorney.
Mr Lewis told the Washington Post: "They got him a job at a local Dollar Store. He was depressed, maybe a little quirky.
"But they never saw anything violent."
On the day of the massacre, Mr Cruz slept in, allegedly giving a bogus excuse to the family.
Mr Cruz then took an Uber to his former school and carried extra loaded ammunition clips, Reuter reports, citing his arrest document.
"He said, 'It's Valentine's Day and I don't go to school on Valentine's Day,'" Mr Lewis said, quoting the parents.
Mr Cruz's lawyer, who was appointed by the court, described him as "a broken human being".
"He's sad, he's mournful, he's remorseful," Melisa McNeill said.