The nine victims of a shooting at a historic black church in South Carolina have been named, after the man suspected of carrying out the "senseless murders" was arrested.
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 had earlier been launched for a gunman who is thought to have sat with church-goers for an hour before spraying the group with bullets at Emanuel African Methodist Episcopal church in downtown Charleston.
County Coroner Rae Wooten said he was accepted by the group before becoming aggressive and violent.
A librarian and recent college graduate were among those killed.
A man who identified himself as Roof's uncle said he had recently been given a handgun as a birthday present by his father, and added he had seemed adrift.
Richard Cohen, president of the Southern Poverty Law Center, which tracks extremists and white supremacist organisations, said Roof appears to be a "disaffected white supremacist" based on his Facebook page.
A photograph on his Facebook page shows Roof dressed in a jacket adorned with the flags of Apartheid South Africa and Rhodesia.
President Barack Obama has expressed "deep sorrow" over the "senseless murders," which are being treated as a hate crime.
A clearly emotional Mr Obama said: "To say our thoughts and prayers are with them and their families and the community doesn't say enough to convey the heartache and the sadness and the anger that we feel."
Police chief Gregory Mullen said city detectives will fly to Shelby to interview Roof about the "heinous crime".
Roof was co-operative with the officer who stopped him, Mr Mullen said, adding officials believe he acted alone.
A tearful Nikki Haley, the state's governor, said the "heart and soul of Carolina is broken," while Charleston mayor Joseph P Riley Jr called the shooting "pure concentrated evil."
Eight people - six females and three males - died at the scene and a ninth victim died later in hospital. Several more were wounded.
The church's pastor, Clementa Pinckney, also a state senator, was among the victims.
The other victims have been named as Cynthia Hurd, 54; Tywanza Sanders, 26; Sharonda Singleton, 45; Myra Thompson, 59; Ethel Lance, 70; Susie Jackson, 87; the Rev. Daniel Simmons Sr., 74; and DePayne Doctor, 49.
Mr Sanders had recently graduated from Allen University in the city of Columbia, while Ms Hurd worked as librarian for more than 30 years.
Mr Doctor was an enrollment counsellor at Southern Wesleyan University's Charleston Campus, according to a friend.
Mr Obama, who knew the pastor, said the outpouring of "strength and unity" from the community shows the "purveyors of hatred" can be overcome.
He also called into question US gun laws, saying communities "have had to endure tragedies like this too many times."
He said: "We don't have all the facts, but we do 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.
"Now is the time for mourning and healing mourning.
"But we have to recognise that this type of violence does not happen in other countries. It doesn't happen in other places with this kind of frequency.
"It is in our power to do something about it."
A police officer told the AFP news agency that some of the bodies of the victims remain inside the building.
The gunman was seen leaving the scene in a black four-door sedan after the massacre at around 9pm local time.
The area where Roof was captured some 13 hours later is around a four-hour drive from the scene.
Local court records show the suspect was charged with a drugs offence in March and trespassing a month later.
In his Facebook profile picture, Roof can be seen wearing a jacket bearing the flags of apartheid-era South Africa and Rhodesia from when the African nations were ruled by the countries' white minorities.
As Roof was being taken into custody, the church was filling up for a prayer service to remember the victims.