A 21-year-old white man suspected of killing nine people at a historic African-American church in Charleston, South Carolina was arrested yesterday after an attack that the United States is investigating as a hate crime.

Law enforcement officials arrested alleged gunman Dylann Roof after a traffic stop in Shelby, North Carolina, about 350 kilometres north of Charleston, said police chief Gregory Mullen.

“This individual committed a tragic, heinous crime last night,” Mullen told reporters.

The mass shooting followed months of racially charged protests over killings of black men which have shaken the United States.

US Attorney General Loretta Lynch said her office was investigating whether to charge Roof with a hate crime motivated by racial or other prejudice.

You rape our women and you’re taking over our country

“The fact that this took place in a black church obviously raises questions about a dark part of our history,” US President Barack Obama told reporters. “We don’t have all the facts but we know that, once again, innocent people were killed in part because someone who wanted to inflict harm had no trouble getting their hands on a gun.”

A man who identified himself as Roof’s uncle earlier told Reuters Roof’s father had recently given him a .45-caliber handgun as a birthday present and that Roof had seemed adrift.

“I don’t have any words for it,” the uncle, Carson Cowles, 56, said in a telephone interview. “Nobody in my family had seen anything like this coming.”

The victims, six females and three males, including Reverend Clementa Pinckney, who was the church’s pastor and a Democratic member of the state Senate, according to colleagues.

Roof sat with churchgoers inside Emanuel African Methodist Episcopal Church for about an hour before opening fire, Mullen said, adding that police believe Roof acted alone.

Mourners gathered to pay their respects outside Morris Brown AME Church during a vigil after a mass shooting in Charleston, South Carolina, yesterday. Photo: ReutersMourners gathered to pay their respects outside Morris Brown AME Church during a vigil after a mass shooting in Charleston, South Carolina, yesterday. Photo: Reuters

The local community reacted with shock and grief after the mass shooting.

Eight victims were found dead in the church, Mullen said, and a ninth died after being taken to hospital. Three people survived the attack.

Roof was charged on two separate occasions earlier this year with a drug offence and trespassing, according to court documents. In a Facebook profile apparently belonging to him, he is pictured wearing a jacket prominently featuring the flags of apartheid-era South Africa and Rhodesia, now Zimbabwe, from when the two African countries were ruled by their white minorities.

Roof’s mother, Amy, declined to comment when reached by phone.

“We will be doing no interviews, ever,” she said before hanging up.

The shooter told one survivor he would let her live so she could tell others what happened, the president of the Charleston NAACP, Dot Scott, told the local Post and Courier newspaper.

A cousin of Pinckney’s, Sylvia Johnson, told MSNBC that a survivor of the shooting told her the gunman reloaded five times during the attack during a Bible-study group. Pinckney tried to talk him out of it, she said.

“He just said, ‘I have to do it. You rape our women and you’re taking over our country,” Johnson said.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.