COLUMBIA, S.C. (AP) — A white supremacist with felony convictions in South Carolina bought a gun from an undercover FBI agent, telling the agent he planned an attack in "the spirit of Dylann Roof," authorities said Thursday.

Benjamin McDowell, 28, was arrested in Myrtle Beach shortly after buying the .40-caliber Glock and ammunition for $109 from the agent who picked him up at his mother's house, then took him to his grandfather's house to get the money, FBI agent Grant Lowe wrote in an affidavit.

McDowell didn't have a specific target in mind, once telling the undercover agent he might just shoot at a party of black people, Lowe wrote.

"I got the heart to do that s---, but I don't have the good training," McDowell said, according to the undercover agent.

McDowell is charged as a felon in possession of a firearm. The gun he was sold had its firing pin filed down so it could not be used, Lowe wrote.

McDowell is being held in the Horry County jail. Court records did not list an attorney, and no one responded to a message left at the phone number listed for his mother's address.

Authorities began investigating McDowell in December after he threatened a synagogue on Facebook. Horry County Police had kept track of McDowell since his release from prison on felony burglary charges a few years ago because he made connections with white supremacists while behind bars, according to the affidavit.

Several days after the threat, McDowell posted on Facebook again, saying fellow white supremacists were all talk and no action.

"All they wanne (sic) do is stay loaded on drugs the Jews put here to destroy white man and they feast on the drugs. they should be Feasting on the enemy that stole their Heritage and their bloodline and trying to run us off of this Earth," McDowell wrote. "if you ain't got the heart to fight for Yahweh like dylann roof did, you need to shut the f--- up."

Roof was sentenced to death in January on federal hate-crime charges for killing nine black worshippers at Emanuel AME church in Charleston in 2015.

Story continues

McDowell also wrote he would like to buy a gun, which got the undercover agent involved, Lowe wrote.

McDowell wanted to commit the attack outside of Horry County and get away without being caught, but didn't give a specific time or place, Lowe wrote.

Court records show that since 2008, McDowell has several convictions for burglary and a conviction for assault.

"Screaming 'white power' was not getting the job done," the undercover agent told Lowe after talking to McDowell. "He indicated he desired a deeper response."

___

Follow Jeffrey Collins on Twitter at http://twitter.com/JSCollinsAP . His work can be found at http://bigstory.ap.org/content/jeffrey-collins