Nikolas Cruz was previously expelled from the high school and was described as "quiet and strange" by his peers.
Nikolas Cruz, 19, has been identified as the suspect in the shooting that killed at least 17 people at the Marjory Stoneman Douglas High School in Parkland, Florida, near Fort Lauderdale, on Wednesday.
The Broward County Sheriff's Office said the gunman was armed with an AR-15 semiautomatic rifle and "countless magazines." Law-enforcement officials familiar with the shooting said the shooter also possessed a gas mask and smoke grenades, Sen. Bill Nelson of Florida said on CNN.
The school's fire alarms went off shortly before the shooting began; Nelson said the gunman was believed to have intentionally set off the alarms "so the kids would come pouring out of the classrooms into the hall" during the shooting.
Following the shooting, Cruz left the high school by blending in with other fleeing students, law-enforcement sources and eyewitnesses told ABC News. He was later apprehended after the police identified him through surveillance videos, the CNN correspondent Martin Savidge reported.
Cruz, who was detained without incident and was transported to the hospital for labored breathing, is the only suspect in the shooting, according to Savidge.
As investigators seek to learn a motive for the shooting, details on Cruz's life have begun to emerge from students and investigators.
Cruz was expelled from Marjory Stoneman Douglas for disciplinary reasons, according to multiple news reports. Though school officials did not confirm the exact reason for Cruz's expulsion, a 17-year-old junior said he was expelled after a fight with his ex-girlfriend's new boyfriend, the Associated Press reported.
Jim Gard, one of Cruz's former teachers, said he was told Cruz "wasn't allowed on campus with a backpack on him," the Miami Herald reported.
A student who attended the same alternative high school as Cruz said he was known to have flaunted pictures of firearms on his phone.
"He shot guns because he felt that it gave him an exhilarating feeling," the student said on Miami’s WSVN-7 News. "He showed me personally through his phone."
"I didn't want to cause any conflict with him because that's the impression he gave off," the student added.
The student also said he had known for two years that Cruz had guns at his home.
"It surprises me the fact that this is going on today, but it doesn't shock me that it was him," the student said. "It was an eye-opener."
Another student who was assigned to a school project with Cruz said Cruz had aspirations to join the military and enjoyed hunting, CNN reported.
"He always just seemed very quiet and strange," the student said. "Just always to himself, never really tried to associate with anybody, but once given the opportunity, he liked to talk."
Cruz's adoptive mother, Lynda Cruz, reportedly had trouble with his behavior in the past. She would occasionally contact the police to give him behavioral advice at their home, Helen Pasciolla, a former neighbor, told The New York Times.
"I think she wanted to scare them a little bit," Pasciolla said. "Nikolas has behavioral problems, I think, but I never thought he would be violent."
Lynda Cruz died in November, according to Fort Lauderdale's Sun Sentinel. Her husband died years earlier of a heart attack; Cruz and his brother were in the care of a family friend at the time of the shooting, people close to the family told the Associated Press.
Cruz is also believed to have posted images of guns and made threats on social-media accounts.
He is believed to have commented nine months ago that he was going to kill law-enforcement officials "one day" because they "go after the good people," a CNN investigative correspondent, Drew Griffin, said.
Cruz was also thought to have said he wished "to kill as many as I can," Griffin reported.
Several pictures posted on an Instagram account believed to belong to Cruz revealed firearms, ammunition, and accessories, such as scopes, The Times reported.
Other images from the account contained pictures of shooting-practice sheets and a man wearing a hat imprinted with the US Army's logo.
Broward County Sheriff Scott Israel, who The Times said had begun learning about Cruz's social-media presence, reportedly called it "very, very concerning."