FBI Director James Comey told reporters Friday "this rips all of our hearts out" and "we are all sick this happened." He said he concluded the mistake had been made Thursday night after reviewing the latest information.
Within days after the shooting, agents on the ground knew something was amiss and suspected that Roof's arrest record should have prohibited the gun purchase, according to law enforcement officials.
Officials began a review, as is common after major shootings. About a week after the shooting, examiners officially denied the Roof application.
Comey said the FBI made the error due to a breakdown in the background check system and confusion with paperwork between the FBI, local police departments and county jurisdictions.
Due to Roof's admission during an arrest in late February that he was in possession of drugs, he should not have been permitted to buy the gun he used in the massacre. However, an agent working for the FBI's background check system who was performing the review on Roof failed to contact the Columbia, South Carolina, police department which arrested Roof, in part because of a clerical error in records listing the wrong agency.
Because Roof's background check took longer than three days to complete, the gun shop owner was allowed to sell the gun to Roof. The law permits gun sellers to sell guns if a background check takes longer than three days to complete.
Roof, the 21-year-old accused of murdering nine African-American attendees
of a bible study class at Charleston's Emanuel AME church
, used .45 caliber handgun to carry out the attack, stopping several times to reload.
Comey ordered a review to be completed within 30 days by the FBI's inspection division. He said that agents met Friday with the families of victims to explain what happened and what the agency will do next.
Reaction on Capitol Hill
Senators across the aisle weighed in on Friday's revelation.
New York Democratic Sen. Chuck Schumer said the case highlighted the need for tougher background checks on gun purchases.
"We simply cannot be allowed to have a background check system that fails to keep guns out of the wrong hands," Schumer said in a statement. "Our current system is broken, and it is costing American lives."
But Chuck Grassley, R-Iowa, emphasized in a statement the need to enforce existing laws, not pass new ones.
"It's disastrous that this bureaucratic mistake prevented existing laws from working and blocking an illegal gun sale," he said. "The facts undercut attempts to use the tragedy to enact unnecessary gun laws. The American people, and especially the victims' families, deserve better."