Gainesville, Georgia (CNN) A 16-year-old white high school student is in custody after her plan to attack an historically black church in Gainesville, Georgia, with knives was foiled, police said Tuesday.

The Gainesville High School student had been planning the attack at Bethel African Methodist Episcopal Church for several weeks, police said.

She took significant steps, including researching black churches online and visiting Bethel AME once this month, police Chief Jay Parrish said. No one was at the church at the time, he said.

A student overheard the teenager talking about the alleged threat on Friday and alerted a school administrator, who in turn notified a school resource officer, Parrish said.

The teenager was taken into custody. She faces a charge of criminal attempt to commit murder, police said. "I have no doubt that we thwarted an attack that would've been ugly," Parrish said.

Read More