Dylann Storm Roof, 21, stayed for nearly an hour inside the church on Wednesday night before shooting six females and three males at a prayer meeting, police chief Greg Mullen said.
Roof put up no resistance after a citizen’s tip-off led police to his car yesterday morning in Shelby, North Carolina, Mullen said.
“Acts like this one have no place in our country,” said Attorney General Loretta Lynch, who announced a Justice Department hate crime investigation.
The Emanuel African Methodist Episcopal Church’s pastor, state Senator Clementa Pinckney, was among those killed. Pinckney, 41, was a married father of two elected at the age of 23, making him the youngest member of the House at the time.
Roof’s childhood friend, Joey Meek, alerted the FBI after recognising him in a surveillance camera image that was widely circulated, said Meek’s mother, Kimberly Kozny.
Roof had worn the same sweatshirt while playing Xbox video games in their home recently. “I don’t know what was going through his head,” Ms Kozny said. “He was a really sweet kid. He was quiet. He only had a few friends.”
Roof had been to jail. State court records show a pending felony drug case against him, and a past misdemeanour trespassing charge.
Roof displayed a Confederate flag on his number plate, Kozny said, and in a photo on his Facebook page, he wore a jacket with stitched-on flag patches from two other defeated white-ruled regimes: Rhodesia and apartheid-era South Africa.
The shooting evoked painful memories of other attacks on black churches. They were bombed in the 1960s when they served as organising hubs for the Civil Rights movement. Many were burned by arsonists in the 1990s. Others survived shooting sprees.
This particular church, which was founded in 1816, had its own grim history: When a founder, Denmark Vesey, tried to organise a slave revolt in 1822, he was caught and white landowners burned the church down in revenge.
Mr Mullen said names of the victims would be released once families have been notified.
President Barack Obama expressed anger, sadness and heartache at the shooting. “At some point, we as a country will have to reckon with the fact that this type of mass violence does not happen in other advanced countries,” he said.
The President said he and Vice President Joe Biden telephoned Charleston Mayor Joseph P Riley Jr to express his condolences.
Obama said he and the First Lady Michelle Obama knew several parishioners there, including the church’s pastor, state Sen Clementa Pinckney, who was among those killed. A vigil was held by parishioners outside the church yesterday.
Meanwhile, Michelle Obama and her elder daughter visited Milan’s Duomo cathedral yesterday, where an official said they lit candles in memory of the victims of the shooting.