Nikolas Cruz legally purchased the AR-15 rifle used in the assault at Marjory Stoneman Douglas High School, law enforcement officials told The Associated Press.
As the criminal case against the suspect took shape, the leader of a white nationalist militia called the Republic of Florida said Cruz was a member of his group and participated in exercises in Tallahassee.
Jordan Jereb told The Associated Press that he had only a brief interaction a few years ago with Cruz, who came across as "a normal Florida white guy."
The group wants Florida to become its own white ethno-state. Jereb said his organization holds "spontaneous random demonstrations" and tries not to participate in the modern world.
"We don't really endorse doing the things he did," Jereb said. "But at the same time, it's inevitable that people are going to go crazy because we live in an inherently sick society," he said, citing "hyper-egalitarianism" and feminism as some of society's ills.
He also said Cruz had "trouble with a girl" and that he believed the timing of the attack, on Valentine's Day, was not a coincidence.
Authorities offered no details about a possible motive, except to say that Cruz had been kicked out of the high school, which has about 3,000 students. Students who knew him described a volatile teenager whose strange behavior had caused others to end friendships with him.
In a national address from the White House, President Donald Trump said he wanted America's children to know, "You are never alone, and you never will be."
He said no child should have to go to school in fear of getting killed. He planned to travel to Florida meet with victims' families, explore how to better secure schools and to "tackle the difficult issue of mental health."
At no point did Trump mention guns or gun-control measures.
Attorney General Jeff Sessions said he wants the Justice Department to study how mental illness affects criminal behavior, to better understand how law enforcement can use existing laws to prevent school shootings.
"It cannot be denied that something dangerous and unhealthy is happening in our country," Sessions told a group of sheriffs in Washington. In "every one of these cases, we've had advance indications, and perhaps we haven't been effective enough in intervening."
Other elected officials also offered ideas for reform.
Republican Gov. Rick Scott said he's already told Florida House Speaker Richard Corcoran that "if someone is mentally ill, he should not have access to a gun."
Broward County Schools Superintendent Rob Runcie said "now is the time to have a real conversation about gun control legislation." And if adults cannot manage that in their lifetimes, he said, students will do it.
Broward County Sheriff Scott Israel called for giving law enforcement more power to detain people who make "graphic threats or post disturbing material online." He would like the authority to bring them involuntarily to mental health professionals to be examined.
Some bodies remained inside the high school Thursday as authorities analyze the crime scene, the sheriff said. The slain included a school athletic director and another adult who worked as a monitor at the school.
Thirteen wounded survivors were hospitalized, including two people in critical condition.
Cruz was ordered held without bond at a brief court hearing. He wore an orange jumpsuit with his hands cuffed at his waist. His attorney did not contest the order and had her arm around Cruz during the short appearance.
It was the nation's deadliest school shooting since a gunman attacked an elementary school in Newtown, Connecticut, in 2012.
Wednesday's shooting was also the 17th incident of gunfire at an American school this year. Of the 17 incidents, one involved a suicide, two involved active shooters who killed students, two involved people killed in arguments and three involved people who were shot but survived. Nine involved no injuries at all.
Trump lamented in a tweet that there were "So many signs that the Florida shooter was mentally disturbed, even expelled from school for bad and erratic behavior. Neighbors and classmates knew he was a big problem. Must always report such instances to authorities, again and again!"
Two federal law enforcement officials say Cruz's rifle, a Smith & Wesson M&P 15 .223, was purchased legally at Sunrise Tactical Gear in Florida. The officials spoke on condition of anonymity because they were briefed on the investigation but not authorized to discuss it publicly.
FBI agent Rob Lasky said the agency investigated a 2017 YouTube comment posted with the screen name Nikolas Cruz that said "I'm going to be a professional school shooter." Lasky said the FBI did a database review, but could not determine the time or location of the post, or the true identity of the person making the comment.
Ben Bennight, whose YouTube username is "BenTheBondsman," posted a video Wednesday saying he had spotted the comment on Sept. 24, took a screenshot, flagged it for YouTube and called an FBI office in Mississippi to report it. He said two FBI agents visited him the next day.
"I knew that I couldn't just ignore that," Bennight said. The FBI called him again Wednesday within about two hours of the shooting, and one agent interviewed him in person, he said.
Cruz's mother, Lynda Cruz, died of pneumonia on Nov. 1 neighbors, friends and family members said, according to the Sun Sentinel . Cruz and her husband, who died of a heart attack several years ago, adopted Nikolas and his biological brother, Zachary, after the couple moved from Long Island in New York to Broward County.
The boys were left in the care of a family friend after their mother died, said family member Barbara Kumbatovich, of Long Island.
Unhappy there, Nikolas Cruz asked to move in with a friend's family in northwest Broward County. That family agreed, and Cruz moved in around Thanksgiving. According to the family's lawyer, who did not identify them, they knew that Cruz owned the AR-15 but made him keep it locked up in a cabinet. He did have the key, however.
Attorney Jim Lewis said the family is cooperating with authorities and had no idea he was planning the shooting.
He seemed like "just a mildly troubled kid who'd lost his mom" during the three months they lived together, Lewis said.
Lewis also said the family was not aware of any other weapons in the gun cabinet he had. Photos posted in an Instagram account linked to Cruz show half a dozen weapons displayed on a mattress and a box of ammunition.
Victoria Olvera, a 17-year-old junior, said Cruz was expelled last school year because he got into a fight with his ex-girlfriend's new boyfriend. She said he had been abusive to the girl.
"I think everyone had in their minds if anybody was going to do it, it was going to be him," said Dakota Mutchler, also 17.