Nikolas Cruz, 19, was arrested about an hour after a shooting rampage at Marjory Stoneman Douglas High School in Parkland, Florida, Broward County Sheriff Scott Israel told reporters.
The sheriff's office earlier spelled the suspect's name as Nikolaus.
Cruz, who had been expelled from the school for reasons that have not been made public, was found with multiple ammunition magazines and one AR-15-style rifle, Israel said.
"We already began to dissect his websites and the things on social media that he was on and some of the things that came to mind are very, very disturbing," Israel said.
Chad Williams, 18, a senior at Stoneman Douglas High school, remembered Cruz as a troubled classmate from when they attended middle school together. He said Cruz would set off the fire alarm, day after day, and finally got expelled in the eighth grade.
More recently, Williams saw Cruz carrying several publications about guns when they ran into each other at the high school. Williams thought Cruz was there to pick up a younger sibling.
"He was crazy about guns," Williams told Reuters, speaking by the side of the road near the high school. "He was kind of an outcast. He didn't have many friends. He would do anything crazy for a laugh, but he was trouble."
Jillian Davis, 19, said she was in a school Junior Reserve Officer Training Corps with Cruz in the 9th grade. She remembered him as a quiet and shy young man who would almost change personality when angry. He talked a lot about guns and knives but no one took him seriously, she told Reuters.
"I would say he was not the most normal or sane kid in JROTC. He definitely had a little something off about him. He was a little extra quirky," said Davis, who graduated from the school last year.
Math teacher Jim Gard told the Miami Herald that Cruz had been banned from returning to campus while carrying a backpack.
"There were problems with him last year threatening students, and I guess he was asked to leave campus," Gard told the newspaper in an interview.
Administrators sent an email to teachers warning them about Cruz, Gard told the paper.
Another student at the school told local WSVN-TV that Cruz was known to have guns at home.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)