Nikolas Cruz, the expelled student suspected of killing at least 17 people and injuring more than a dozen others at his former high school in Parkland, Florida, was described by his former classmates as a loner with a temper. On Thursday, the Broward County Sheriff’s Office said Cruz confessed to being the shooter.

The 19-year-old was charged Thursday with 17 counts of premeditated murder, after he allegedly opened fire at Marjory Stoneman Douglas High School on Wednesday afternoon. The Marjory Stoneman Douglas shooting is the 6th school shooting resulting in injuries this year. There have been 17 incidents of gunfire in schools this year, according to gun control group Everytown USA.

Authorities said Cruz used an AR-15 rifle — a semi-automatic assault-style rifle that has been used in numerous other mass shootings — in the shooting. He also hid additional magazines in his vest and backpack, according to the police report. The suspect, who was expelled from the school last year for disciplinary reasons, was taken into custody about an hour after fleeing school grounds. Authorities believe the suspected shooter worked alone.

Described by former classmates as “loner,” Cruz was an orphaned teenager whose mother died in November 2017, according to The Sun-Sentinel. His mother and her husband, who died years ago, according to the paper, had adopted Cruz and his biological brother. The two boys had then moved in with a family friend, an attorney for the family told the Associated Press.

“This totally came out of left field. They had no idea, no predilection,” James Lewis, the attorney, said. “They had no clue that this kid was dangerous,” he added.

A leader of a Florida white supremacist militia called the Republic of Florida had claimed that Cruz was a member of the organization and had participated in a training exercise, but later appeared to back away from that claim.

Lt. Grady Jordan with the Leon County Sheriff’s Office in Tallahassee said investigators have found “no known ties” between Cruz and Republic of Florida, a group that his office tracks.

More than 3,200 students attend Marjory Stoneman Douglas High School, where approximately 130 teachers work. Videos published as the shooting unfolded showed dozens of students streaming out of classrooms as authorities escorted them out of classrooms following a lockdown. Graphic images and videos posted by students inside these classrooms showed children crying and blood on the floors in the aftermath.

The suspect appeared in court on Thursday and was ordered to be held in jail without bond. Public defenders representing Cruz argued that he had brain development issues, as well as mental illness. They described Cruz as deeply sad, “saddened by the loss of these children” in the shooting,” and called him “a broken child.” Among the conditions that public defenders said Cruz grappled with was trouble with impulse control.

Shooting Timeline

Broward County Sheriff Scott Israel said in a news conference Thursday that the suspect arrived at the high school Wednesday at 2:19 p.m., getting a ride from an Uber car. He entered the school’s building 12 with his rifle in a soft, black case, and began shooting at 2:21 p.m. During his rampage, the shooter fired into five classrooms across three floors of the building, according to the sheriff.

Next, after making his way up three floors, the suspect dropped his rifle and backpack and ran outside toward the tennis courts at 2:28 p.m. “The suspect crossed fields and ran west along with others who were fleeing, and tried to mix in with the group that were running away, fearing for their lives,” said Israel.

Then the suspect ran to a Wal-Mart at 2:50 p.m., where he bought a drink at a Subway restaurant, said the sheriff. He went to a nearby McDonalds ten minutes later and left shortly after. A police officer found the suspect walking, and arrested him without incident at 3:41 p.m.

Accounts from Peers

Students at the school described Cruz as a “loner” and a “troubled kid’ in interviews after the suspected shooter opened fire at his former high school. Some said Cruz was a quiet “outcast.” Others described him as someone who would act up when he was angry and describe the kinds of weapons he owned.

“All he would talk about is guns, knives and hunting,” former classmate Joshua Charo, 16, told the Miami Herald. “I can’t say I was shocked. From past experiences, he seemed like the kind of kid who would do something like this.”

One student said kids at the school joked that Cruz would end up opening fire at the school one day — a similar anecdote used by former classmates of Omar Mateen, the gunman who killed 49 people and injured 53 others at Pulse nightclub in Orlando, Fla., in 2016.

“A lot of kids threw jokes around like that, saying that he would be the one to shoot up the school. It turns out, you know, everyone predicted it,” one student told WJXT, a Jacksonville, Florida, news station. “It’s crazy.”

Jim Gard, a math teacher at Marjory Stoneman Douglas who taught Cruz in 2016, told CNN Cruz was “a quiet kid in class” and “never had any problems” with him before he was expelled. But, speaking with Miami Herald, Gard said that he believed an email from the school administration had circulated among teachers, warning that Cruz had made threats against other students.

“We were told last year that he wasn’t allowed on campus with a backpack on him,” Gard said. “There were problems with him last year threatening students, and I guess he was asked to leave campus.”

Ocean Parodie, a 17-year-old student at the school, told The Daily Beast Cruz once yelled in class. “He was upset and just started yelling at the teacher,” Parodie said. “The teacher was trying to help him and he just took it the wrong way.”

Superintendent Robert Runcie of the Broward County School District told reporters school officials had received no warnings or threats of the shooting before it happened. “Potentially there could have been signs out there,” he said. “But we didn’t have any warning or phone calls or threats that were made.”

Life at Home

Cruz lived with a friend’s family after the death of his mother in November and worked at a local Dollar Tree store while attending school at an adult education center, the attorney for the family said.

He “seemed to be getting his life back together, getting over his depression, the loss of his mother,” Lewis, the attorney, told the Associated Press. “And this totally came out of left field.”

Cruz had been expelled from Marjory Stoneman Douglas High School last year. Though officials had declined to say why Cruz had been expelled, the mother of one student told the New York Times he had brought knives to campus.

After Cruz’s mother died in November, he lived with his friend’s family, according to their attorney. At their home, Cruz had a firearm locked in a cabinet, Lewis said, adding that there are “a lot” of 18- and 19-year-olds with firearms in the area. “This is about something went seriously wrong with this kid, and no one can explain it right now,” Lewis said.

The family had another son who attended the school, Lewis said, and was on campus during the shooting. The son had no involvement in the shooting, Lewis said. He said the family did recall Cruz saying on Wednesday morning that he would not be going to school because he “doesn’t go to school on Valentine’s Day.”

“So why this happened?” Nobody saw it coming and nobody knows why,” the attorney said.

Helen Pasciolla, a retired neighbor who lives in the Cruz family’s former neighborhood in Parkland, told the New York Times that Cruz had regular behavioral problems. Pasciolla said their mother would sometimes call the police to come over and talk to Cruz.

“Nikolas has behavioral problems, I think, but I never thought he would be violent,” Pasciolla said to the Times.

Broward County Mayor Beam Furr told CNN the suspected shooter had gotten treatment from a mental health clinic for a period of time. “It wasn’t like there wasn’t concern for him,” 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.”

Documents uncovered by the Miami Herald also revealed that Florida’s Department of Children and Families investigated Cruz after he posted Snapchat videos that showed him cutting his arms. The report listed Cruz as an “alleged victim” of medical neglect and inadequate supervision, but he was deemed stable.

Emerging Social Media Profile

Authorities have begun looking into what they describe as Cruz’s social media profile, findings which Sheriff Israel described to reporters as “very, very disturbing.”

In September 2017, YouTube user Ben Bennight told the FBI about a worrisome comment left on one of his videos written by another user named “nikolas cruz.” The comment, as detailed by an FBI agent at a press conference Thursday, said, “I’m going to be a professional school shooter.” Bennight told BuzzFeed News that the FBI visited him in September and asked if he knew the user. He said he did not, and the FBI “took a copy of the screenshot and that was the last I heard from them,” he said.

YouTube and Bennight did not respond immediately to requests for comment from TIME.

Unverified images on social media accounts cited by multiple media sources appear to show a man holding firearms, wielding knives, and showing a collection of guns on a bed.

Daniel Huerfano, a student who fled Wednesday’s attack, told the AP he recognized Cruz from an Instagram photo where he posed with a gun in front of his face.

A 17-year-old junior named Dakota Mentcher also recalled to the AP that Cruz had posted Instagrams about killing animals. Mentcher said Cruz would also talk 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,” Mentcher said. “I think everyone had in their minds if anybody was going to do it, it was going to be him.”

This story has been updated to reflect more detail about how Everytown for Gun Safety categorizes an incident as a school shooting.

Correction: The original version of this story included a claim from Jordan Jereb, the leader of white supremacist organization The Republic of Florida, that Nikolas Cruz was a member of his group. Jereb has since withdrawn that claim.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Abigail Abrams at abigail.abrams@time.com.