A white supremacist gunman told his black victims "you rape our women and you're taking over our country" as he massacred nine people inside a historic African-American church in the southern city of Charleston.
The suspect, Dylann Storm Roof (21), was captured 14 hours after the shooting but the killing spree left the United States agonising over how to face up to the bloodiest hate crime in decades.
"This is not the first time that black churches have been attacked," said US President Barack Obama. "We know that hatred across races and faiths poses a particular threat to our democracy and our ideals."
The young suspect seems to have been steeped in white supremacist culture and the FBI said the killings were being treated as a hate crime. He posed in a jacket with the insignia of Apartheid South Africa and had the flag of the Confederacy on his car's registration plate.
Roof allegedly arrived at the Emanuel African Methodist Episcopal Church at around 8pm on Wednesday and sat in a Bible study group with his victims for more than an hour before opening fire.
Among the dead was Reverend Clementa Pinckney, the church pastor and a local politician, and his sister. Six women and three men were killed.
Sylvia Johnson, a cousin of Reverend Pinckney, told NBC she had spoken to one of the survivors who claimed that the gunman tried to justify the killings as he slaughtered his victims.
"I have to do it," he reportedly said as he reloaded his gun five times. "You rape our women and you're taking over our country and you have to go."
As his victims lay dying in the church, the gunman fled into the night and sparked a vast manhunt throughout the southern United States.
Roof's car was pulled over by police yesterday afternoon in Shelby, North Carolina, around 200 miles from the scene of the crime. Police said a local resident had raised the alarm after seeing his car and Roof offered no resistance as he was arrested.
The Emanuel Church, sometimes referred to as 'Mother Emanuel', is one of America's most historic black places of worship and Mr Obama called it "more than a church".
One of its founders was executed for leading a slave uprising and it was burnt to the ground in retaliation by white slave owners only to be built again. Martin Luther King spoke there in 1962 during the civil rights struggle.
"Mother Emanuel church and its congregation have risen before - from flames, from an earthquake, from other dark times - to give hope to generations of Charlestonians," Mr Obama said. "With our prayers and our love, and the buoyancy of hope, it will rise again now as a place of peace."
The president also renewed his calls for new gun control laws, saying the US was the only advanced economy to suffer "this type of mass violence".
The massacre comes as America continues an often painful national debate about race and policing.
Barely 12 hours after the shooting, mourners of all races gathered at the nearby Morris Brown African Methodist Episcopal church to hold a vigil for the dead. Among them was Vanessa Halyard, who knew Rev Pinckney and described him as "a man doing God's work".
Mrs Halyard (59) said when she heard the news of the shooting she immediately "flashed back" to the bombing of a black church in Alabama in 1963. The explosion, caused by a bomb planted by the Ku Klux Klan, killed four young black girls.
"They don't wear white hoods anymore but there's still so much hate and anger out there," she said. "We're in a different place as a country now but we're also in the same place."
Roof was arrested on suspicion of trespassing in April but does not appear to have been charged. He was also jailed briefly in March on a drugs charge.
Carson Cowles, the suspect's uncle, said his nephew was a "quiet, soft-spoken" person.
A former classmate at the White Knoll High School said Roof "used drugs heavily" and was interested in the history of the Southern Confederacy.
Police have not said if they recovered a gun during the arrest, but Roof's uncle said his father had given him a .45 pistol for his 21st birthday in April.
Roof is due to appear in court in North Carolina before being extradited to South Carolina to face charges.