The revelation that the FBI botched a potentially life-saving tip on the Florida school shooting suspect is a devastating blow to America's top law enforcement agency at a time when it is already under extraordinary political pressure.
Even before the startling disclosure that the FBI failed to investigate a warning that the suspect, Nikolas Cruz, could be plotting an attack, the bureau was facing unprecedented criticism from President Donald Trump and other Republicans, who have accused it of partisan bias.
The agency and its supporters had been able to dismiss past criticism as just politics, but this time it had no option but to admit it made a disastrous mistake.
The FBI's acknowledgment that it mishandled the tip prompted a sharp rebuke from its boss, Attorney General Jeff Sessions, and a call from Florida's Republican Gov. Rick Scott, a Trump ally, for FBI Director Christopher Wray to resign.
Wray, on the job for just six months, had already been in a precarious position defending the bureau from relentless attacks by Trump and other Republicans. They are still dissatisfied with its decision not to charge Hillary Clinton with crimes related to her use of a private email server, and they see signs of bias in special counsel Robert Mueller's probe of possible Trump campaign ties to Russia.
As evidence, they've cited the former deputy director's connection to Clinton allies, and they've publicized anti-Trump text messages exchanged between an FBI agent and a bureau lawyer. Democrats have said the accusations are aimed at damaging Mueller's investigation and protecting Trump.
Through it all, Wray has repeatedly stood up to Trump, defending the bureau's independence and publicly praising its agents in implicit rebuttals to the president's criticism. Wray unsuccessfully fought to block the release of a classified Republican memo accusing the FBI of abusing its surveillance powers in the Russia probe — a document Trump wanted aired. Wray also publicly contradicted White House accounts of how it handled recent domestic abuse allegations involving an aide.
The shooting provides fresh grounds to criticize the FBI. First it was revealed that the FBI failed to delve into a YouTube comment posted by a "Nikolas Cruz" that said, "Im going to be a professional school shooter." The FBI said it could not determine who made it.
On Friday, the bureau said it had failed to act on a tip that Cruz had a "desire to kill people," disturbing social media posts and access to a gun. Cruz is charged with killing 17 people in the school he once attended.
Sessions, a Trump loyalist who has at times seemed to welcome criticism of the FBI, called the massacre a "tragic consequence" of the FBI's failure. He ordered a review of the Justice Department procedures.
The House Judiciary and Oversight committees, whose Republican leaders have been some of the strongest FBI critics, demanded Wray brief them on what went wrong.
Sen. Marco Rubio, a Florida Republican, said it was "inexcusable" the FBI did not follow protocols and urged Congress to launch its own investigation. Democratic Rep. Ted Deutch of Florida promised to be in "close communication with the FBI so we can get to the bottom of this."
Wray apologized in a rare statement admitting the FBI's missteps. But Scott, the governor, said that "isn't going to cut it."
"People must have confidence in the follow-through from law enforcement," he said, calling for Wray to step down.
This isn't the first time the FBI has been seen as missing an opportunity to prevent a major violent attack. The white supremacist who killed nine people at a historically black church in South Carolina in 2015 was able to purchase his weapon only because of breakdowns in the FBI's background check system. The background check examiner who evaluated the shooter's request to buy a gun never saw an arrest report in which he admitted to possessing illegal drugs. Under federal rules, that should have been enough to disqualify him from a gun purchase.
Congress in 2009 criticized the FBI for missteps ahead of a shooting that left 13 people dead at Fort Hood, Texas, after finding that agents failed to act on emails between the gunman and terrorist Anwar al-Awlaki.
In the Florida school shooting, "somebody made a mistake, somebody did not do their job," said Jeffrey Ringel, a former FBI agent and Joint Terrorism Task force member who now works for the Soufan Group, a private security firm.
"The FBI will be criticized for a failing that they have basically owned up to," he said. "It's a learning lesson. Unfortunately, a very expensive learning lesson."