Dylann Roof, 21, was taken into custody in Shelby, North Carolina, during a traffic stop after a member of the public called the police.
A manhunt was launched for the suspect, who sat with church-goers for an hour before spraying the group with bullets.
Shock and anger engulfed America as police nabbed a white young man who killed nine people at a historic African-American church in Charleston in South Carolina, saying he was there “to shoot black people”.
The FBI identified the suspect in Wednesday night’s deadly shooting at the Emanuel African Methodist Episcopal Church in Charleston as 21-year-old Dylann Roof of Lexington, South Carolina, as police searched the region on Thursday.
Police arrested Roof in Shelby in North Carolina, a town east of Charlotte and just north of the South Carolina state line after a massive manhunt.
The man spent an hour in a prayer meeting at the church on Wednesday night before he opened fire, CNN reported citing Charleston police chief Greg Mullen, who called the attack a hate crime.
Among those killed were Rev. Clementa Pinckney, the church’s pastor and a state senator. Other victims in the church shooting were six women and two men.
Three people survived, including a woman who received a chilling message from the shooter.
“Her life was spared, and (she was) told, ‘I’m not going to kill you, I’m going to spare you, so you can tell them what happened’,” Dot Scott, president of the Charleston unit of the National Association for the Advancement of Colored People (NAACP), told CNN.
Scott said she heard this from the victims’ family members.
The NAACP is a civil rights organisation for ethnic minorities in the US.
A picture of the suspect on social media showed him wearing a jacket with what appear to be the flags of apartheid-era South Africa and nearby Rhodesia (now Zimbabwe), a former British colony that was ruled by a white minority until independence in 1980.
According to Atlantic weekly, the shooting spree in Charleston was the latest assault on black churches for generations.
Black churches have suffered at the hands of thugs and terrorists throughout the Civil Rights era, as they had for a century before, it said.
On September 15, 1963, Klu Klux Klan terrorists bombed the 16th Street Church in Birmingham in Alabama, killing four girls, it recalled.
As recently as the 1990s, a wave of fire-bombings hit black churches.
In South Carolina alone, black churches that suffered probable arson attacks included Mt. Zion AME Church in Williamsburg, Macedonia Baptist Church in Manning, Saint Paul Baptist Church in Lexington, Rosemary Baptist Church in Barnwell, St. John Baptist Church in Dixiana, Effington Baptist Church, Mount Olivet Baptist Church, and Allen’s Chapel, according to Atlantic.