He had a "very disturbing" social media presence and had been expelled from school, officials said, supplying new details on the life of accused shooter, Nikolas Cruz.

Cruz, 19, has been charged with 17 counts of premeditated murder in the attack Wednesday at Marjory Stoneman Douglas High School in Parkland, Florida, which he was expelled from last year for disciplinary reasons, officials said. The attack unfolded just before classes were dismissed for the day.

Cruz, who arrived at the scene in an Uber, confessed to the attack, telling investigators he had brought the AR-15 and several loaded magazines stuffed into a backpack and planned to leave them behind in order to blend in with fleeing students, according to a police affidavit. After the shooting, he made it to a Walmart, where he bought a drink, then continued to a McDonald's, where he sat for a bit, Broward County Sheriff Scott Israel said at a news conference Thursday evening. Soon after leaving, Cruz was arrested,

A motive in the shooting remains unclear.

Cruz legally bought the .223-caliber rifle used in the shootings in February 2017 at Sunrise Tactical Supply, a federally licensed gun store in Coral Springs, authorities said.

Cruz's court-appointed defense lawyer, Broward County Assistant Public Defender Melisa McNeill, called him "a broken human being" and said he was "mournful, remorseful" and "fully aware of what is going on."

That Instagram page also has pictures of a figure, face obscured by bandannas and holding knives. Another shows a young man, presumably Cruz, holding a pistol, although it's not clear whether the gun is real.

Nikolas Cruz poses in a picture posted to his Instagram account which was verified by the Miami Herald.via Instagram

Cruz, who was ordered held in jail Thursday without bond, also may have posted something of a warning on YouTube. A Mississippi bail bondsman said he notified the FBI last year about a comment under a video by someone named "nikolas cruz" that said, "Im going to be a professional school shooter."

An FBI official in Florida confirmed the basics of that account, saying agents followed up but were unable to confirm the identification of who made the comment.

Israel, the sheriff, said investigators were reviewing social media postings that he described as "very disturbing."

Other pieces of Cruz's troubled life are becoming clear.

Adopted at birth, he was orphaned in November when his mother, Lynda Cruz, died, a relative told The Miami Herald and The Sun Sentinel newspapers. His father died when he was young, they said.

Barbara Kumbatovich, Lynda Cruz's sister, told The Miami Herald that she believed Nikolas Cruz was on medication to deal with emotional issues. "She was struggling with with Nikolas the last couple years," she said.

Cruz had a semi-automatic rifle, but the family required that he keep it locked in a cabinet, Lewis told The Miami Herald. On Wednesday morning, Cruz slept in and gave only a cryptic reason why.

“He said, ‘It’s Valentine’s Day and I don’t go to school on Valentine’s Day,’” Lewis said.

Neighbors who lived near Lynda Cruz said they remembered Nikolas as a troublemaker.

“He wore a hoodie and always had his head down,” Janine Kartiganer told The Sun Sentinel. “He looked depressed.”

Malcolm and Christine Roxburgh told The Sun Sentinel that Cruz used to harass neighbors and that police were called to the Cruz house several times. Christine Roxburgh said she caught Nikolas Cruz peeking in her window once. She also told the paper that he banged his head against a brick wall when he didn't want to go to school.

After his expulsion from Douglas, Cruz attended a different school in the district, the Broward County schools superintendent, Robert Runcie, said. Cruz also worked at a nearby Dollar Tree, the chain store company confirmed.

Broward County Mayor Beam Furr told NPR that Cruz "had been a client as some mental health facilities" and was now "one of those ones where we miss the signs."

But Runcie told MSNBC that the district "received no warning sign, really, about this particular tragedy."

On the day of the shooting, Cruz took an Uber to the Douglas campus, Runcie said. After the attack, Cruz hid in the crowd fleeing the school, authorities said. He was arrested in nearby Coral Springs about an hour later.

Brandon Minoff, a senior at Douglas who said he had two classes with Cruz two years ago, said that while it was "surreal" to hear Cruz named as the suspect, "I wasn't surprised."

"I got paired with him for a project, and he started talking to me about his life — how he was held back twice, expelled from two private schools," Minoff said. "He likes to do reckless stuff."

Douglas student Drew Fairchild told The Miami Herald that in 9th grade Cruz "used to have weird, random outbursts, cursing at teachers.” And former classmate Nicholas Coke recalled to the paper an incident in middle school when Cruz kicked out a glass window.

Another former classmate, Joshua Charo, told the paper that Cruz seemed to only want to talk about "guns, knives and hunting."

Cruz "used to tell me he would shoot rats with his BB gun and he wanted this kind of gun, and how he liked to always shoot for practice,” Charo said.

Charo said Cruz was suspended from Douglas for fighting and because he was found with bullets in his backpack.

Student Victoria Olvera told The Associated Press that Cruz was kicked out of Douglas for fighting with a boy who had been seeing his ex-girlfriend.

Douglas senior Sebastian Toala told NBC Miami, "I never really got close to him, because I always had a feeling there was something wrong."

Not everyone saw him that way, though.

Student Jonathan Guimaraes told The Sun Sentinel that he and Cruz were in Junior Reserve Officers' Training Corps together and said he was "normal" and "didn't have any issues.”

Spanish teacher Alicia Blonde told MSNBC she taught Cruz when he was a sophomore, describing him as small in stature and demeanor. He often wore his JROTC uniform, but was an undisciplined student, Blonde said. Cruz also was reluctant to speak in Spanish, despite his Hispanic background.

"I think there was some pride issues there. He didn't feel comfortable in his own skin and culture," Blonde said.

Sophomore Isabella Gomez said she recognized Cruz as a "strange kid" whom she often saw around school. She recalled that when Cruz was prohibited from carrying a backpack he carried his things in a Ziploc bag.

Gomez said she had a troubling brief encounter with Cruz, when they bumped into each other in a hallway. "I used to say he looks like no good," Gomez said.