FBI Director Christopher Wray said the bureau is investigating what happened.

“We have spoken with victims and families, and deeply regret the additional pain this causes all those affected by this horrific tragedy,” Wray said in a statement.

A video blogger had said he warned the FBI in September about a possible school shooting threat from aYouTube user with the same name as Cruz. An FBI agent confirmed that a field officer in Jackson, Mississippi, received the tip and interviewed the person who shared it.

But no additional information was found to help identify the person who posted the comment and no connection was made to South Florida, said Robert Lasky, FBI special agent in charge of the Miami division.

Social media posts

Cruz’s apparent digital footprint includes slurs against blacks and Muslims, and declarations of a desire to shoot people. Other social media posts include a photo of a rifle, a collection of firearms on a bed, and a photo taken through a scope looking out a window.

Cruz was staying with the family of someone he met at the high school after his adoptive parents died, said Jim Lewis, the host family’s attorney.

That family knew he had a gun. “They had it locked up, and believed that that was going to be sufficient, that there wasn’t going to be a problem,” Lewis said.

The family was unaware of any mental illness beyond depression over his adoptive mother’s death, Lewis said.

But Gordon Weekes, executive chief assistant of Broward’s public defender’s office, said Thursday that Cruz is “suffering from significant mental illness and significant trauma.”

Before his mother died, Broward sheriff’s deputies were called to the Cruz family home 39 times since 2010, according to documents obtained by CNN.

The sheriff’s office received a range of emergency calls that included reports of a mentally ill person, child/elderly abuse, a domestic disturbance and a missing person.

There were 20 calls for service over the past “few years” pertaining to Nikolas Cruz, according to Broward County Sheriff Scott Israel.

Cruz is being held without bond following his video hearing Thursday in Broward County court.