Revelations that the FBI had been warned about Florida high school shooter Nikolaus Cruz fit an all-too-familiar pattern, in which apparent law enforcement errors have preceded mass murders.

A person close to Cruz warned the the FBI last month that he had a “desire to kill people” and could carry out a school shooting, the FBI admitted on Friday. The agency failed to act on the tip.

The FBI was also warned about Cruz after he posted on YouTube saying he was going to become a “professional school shooter.” The agency said they couldn’t identify the user who made the threat, despite Cruz posting under his own name.

Five months after the tip about the YouTube comment, and one month after the FBI was alerted that Cruz had a “desire to kill people” and could become a school shooter, the 19-year-old pulled the fire alarm at Marjory Stoneman Douglas High School and began shooting his former classmates with his AR-15.

Other mass shooters and terrorists were similarly on the FBI’s radar — or should have been — before they carried out their deadly attacks.

Dylann Roof, who in 2015 shot nine people at a black church in Charleston, was allowed to purchase his weapon in part because of errors by FBI agents during the background check process, the agency said.

Pulse shooter Omar Mateen, who pledged allegiance to ISIS before killing 49 people at the Orlando nightclub, similarly seemed to have fallen through the cracks. The FBI investigated Mateen twice before the slaughter but ruled him not a threat both times.

The FBI knew that Fort Hood shooter Army Maj. Nidal Hasan had been in contact with al Qaeda terrorist Anwar al-Awlaki, but declined to investigate him. A congressional probe found that the FBI had failed to alert the Army about Hasan, and that the shooting could and should have been prevented. Hasan killed 13 people and wounded dozens of others in the 2009 shooting.

The FBI similarly missed opportunities to stop Tamerlan Tsarnaev, one of the brothers behind the 2013 Boston Bombing, a government review found. Russia warned the United States that Tsarnaev had associations with Islamic terrorists, leading an FBI-led task force to question the future terrorist. The agent who interviewed Tsarnaev closed the probe “having found no link or ‘nexus’ to terrorism.”

The task force was alerted a year later that Tsarnaev was leaving the country for Dagestan but declined to interview him or stop him from leaving the country. FBI agents later said the failure to interview Tsarnaev was a “huge” error, according to Boston Magazine.

Another school shooter who was on the FBI’s radar killed two students at a New Mexico high school just two months ago. Although the killing doesn’t meet the government’s definition of a mass shooting, the shooter was known to the FBI. The agency investigated the shooter, 21-year-old William Atchison, in 2016 after he commented online about committing a mass shooting.

This article has been updated to include the FBI’s statement on Friday, Feb. 16.