(Source: J. Reuben Long Detention Center)

Benjamin Thomas Samuel McDowell, 29, was arrested Wednesday after he purchased a .40 caliber Glock handgun with ammunition from an undercover FBI agent. 

A federal complaint states he bought the gun to commit an attack "in the spirit of Dylann Roof," the attacker who killed 9 in a Charleston church shooting June 17, 2015.

According to the complaint, McDowell had been spending time online ranting about his hatred of Jews and even posted a link to a page for the Temple Emanu-El Conservative Synagogue in Myrtle Beach, stating, "I love love to act what u think."

McDowell is an ex-convict who allegedly met several white supremacists in prison and built friendships with them. While out, he spent a lot of time online voicing his opinions on Jews, who he believed were going to wipe out the white race.

He was caught after he bought a gun from an undercover FBI agent he met in a hotel.  He told the agent he wanted to attack non-whites and walk away without being caught because he hated prison. He told the agent he "seen what Dylann Roof did and in my heart I reckon I got a little bit of hated... I want to do that s***."

He faces felony charges for possession of a firearm.