The FBI received a tip about Parkland shooter Nikolas Cruz last month that he had been behaving erratically and threatening to kill people, but according to the agency, “protocols were not followed.”

According to a statement released Friday, a person close to Cruz called the FBI’s public tip line on Jan. 5, more than a month before the Wednesday shooting at Marjory Stoneman Douglas High School in South Florida, with concerns about him.

“The caller provided information about Cruz’s gun ownership, desire to kill people, erratic behavior, and disturbing social media posts, as well as the potential of him conducting a school shooting,” the statement said.

However, “protocols were not followed for the information received,” the FBI said, explaining that the information provided should have been “assessed as a potential threat to life.”

“The information then should have been forwarded to the FBI Miami field office, where appropriate investigative steps would have been taken,” the FBI said Friday. “The information was not provided to the Miami field office, and no further investigation was conducted at that time.”

Cruz, a 19-year-old former student, opened fire at the high school on Wednesday, killing 17 and injuring 15 more. Cruz, who was arrested shortly after the attack, has reportedly confessed to the crime.

FBI Director Christopher Wray said the agency is “still investigating the facts.”

“I am committed to getting to the bottom of what happened in this particular matter, as well as reviewing our processes for responding to information that we receive from the public. It’s up to all Americans to be vigilant, and when members of the public contact us with concerns, we must act properly and quickly,” Wray said.

He added: “We have spoken with victims and families, and deeply regret the additional pain this causes all those affected by this horrific tragedy. All of the men and women of the FBI are dedicated to keeping the American people safe, and are relentlessly committed to improving all that we do and how we do it.”

Sen. Marco Rubio, R-Fla., called the FBI's misstep "inexcusable."

“Both the House and Senate need to immediately initiate their own investigations into the FBI’s protocols for ensuring tips from the public about potential killers are followed through," he said in a statement.

According to reports, Cruz had a chilling online presence, often seen posing with guns and knives on Instagram.

A defense attorney has described him as “a broken child.”