The Gainesville High School student had planned the attack on the Bethel African Methodist Episcopal Church for several weeks, police said with Jay Parrish. At the time, nobody was in the church, he said.
One student overheard the teenager talking about the alleged threat on Friday and alerted a school administrator who in turn notified a clerk, Parrish said.
The teenager was taken into custody. She is charged with criminal murder, the police said.
"I have no doubt that we thwarted an attack that would have been ugly," said Parrish.
The teenager turned on Bethel AME for his African-American parishioners and small community. "I know she did a lot of research on the internet, which she wanted to do," said Parrish. "I think she wanted to make a name for herself and she visited African American churches."
He said that although there are several black churches in Gainesville, "it somehow landed on this and that became the target."
Police informed pastor Bethel AME after she learned of the alleged plot.
The boss said it was a "divine intervention" that no one was in the church when the teenager visited them. He thinks she had the knives with her.
Police believe the girl acted alone. No other churches are at risk, Parrish said.
Principal Jeremy Williams said, "One single act of a student does not represent the views and beliefs of the Gainesville City school system."
"As a school system that celebrates our diversity, we are unbelievably impressed by the recent development, but we are extremely proud that our students are notifying the school administration about a possible off-campus threat," he said.
The teenager's plans were very detailed, the boss said.
"I am deeply disturbed that someone feels that way and takes these essential steps to attack an innocent person, a divine person, in a church, one of the holiest things our society has left," said Parrish.
Parrish, a Gainesville man, said the alleged conspiracy was "the opposite of who we are."
"I have been in this community all my life and this is not a representation of us," he said.
Nick Valencia and Pam Kirkland reported from Gainesville and Darran Simon reported and wrote in Atlanta. CNN's Amanda Watts contributed to this report.