CHARLESTON, S.C. — Dylann Storm Roof — a skinny, young white man with a bowl haircut — entered a historic black church, sat down next to its well-known pastor for a Bible study and, about an hour later, according to police, he pulled out a gun and killed nine people in a race-fueled mass shooting that reignited talk about guns and racism in America.
While officials said they don’t know the motive, a survivor reportedly said Mr. Roof made racially charged comments before opening fire, leaving one person alive to tell the story.
“I have to do it. You rape our women and you’re taking over our country. And you have to go,” a survivor told the dead pastor’s cousin of the assassin’s proclamations.
From his Facebook page to testimonial from friends, there were other indications of racist intent from Mr. Roof, who was arrested Thursday and now likely faces capital murder charges in one of the nation’s most conservative states.
President Obama, who personally knew the slain pastor, state Sen. Clementa Pinckney, called the killings “senseless” and used the attack to renew his call for gun control as black community activists raised alarms about potential race riots.
“We don’t need anymore bloodshed, and we don’t need a race war,” pleaded J. Denise Cromwell, a black community activist. “Charleston has a lot of racial tension. We’re drowning and someone is pouring water over us.”
Ms. Cromwell said nerves were still raw from the fatal shooting two months ago of a black man, Walter Scott, by a white police officer in neighboring North Charleston, which ignited major protests.
Black activist Michelle Felder, 58, said she feared the city’s young people “aren’t thinking” and might seek revenge, an emotional reaction that she said she understood but was mature enough to resist.
“This is 2015, and we are still going through the same things we went through 50 years ago,” she said. “This is so sickening. We are so tired.”
Religious and political leaders repeatedly called for calm, and impromptu prayer gatherings and vigils were held across the state and country.
Mr. Roof, 21, was captured without resistance Thursday about 200 miles away in Shelby, North Carolina, after an all-night manhunt.
A gun was found in the car, though it was not immediately clear whether it was the same .45-caliber weapon that, according to his uncle, the young man had received from his father as a 21st birthday gift.
Joseph Meek Jr., a friend of Mr. Roof who helped authorities Thursday, told The Associated Press that the suspect told him recently that black people were taking over the world and that something needed to be done for the white race.
Mr. Meek says that Mr. Roof’s racial comments came completely out of the blue and that his friend had been nothing like that before they lost touch about five years ago.
Photos of Mr. Roof on his Facebook page show him in a jacket bearing icons widely understood as racist — the former flags of South Africa and Rhodesia (now Zimbabwe) from a time when both countries had a white minority ruling over much larger black populaces oppressed by second-class citizenship and segregation.
He also had a Confederate flag on his license plate.
Mr. Roof wasn’t known to the Southern Poverty Law Center in Montgomery, Alabama, and it’s not clear whether he had any connection to the 16 white supremacist organizations operating in South Carolina. Richard Cohen, the center’s president, said the Facebook page makes him look more like a “disaffected white supremacist.”
The shooting evoked painful memories of other attacks. Black churches were bombed in the 1960s, when they served as organizing hubs for the Civil Rights movement, and there was a spate of arsons across the South in the 1990s. Others survived shooting sprees.
Nor was Wednesday night the first racist assault at the victimized church, Emanuel African Methodist Episcopal, which traces its history back to the 1810s. A founder, Denmark Vesey, was hanged after trying to organize a slave revolt in 1822, and white landowners burned the church in revenge, leaving parishioners to worship underground until after the Civil War.
This shooting “should be a warning to us all that we do have a problem in our society,” said state Rep. Wendell Gilliard, a Democrat whose district includes the church. “There’s a race problem in our country. There’s a gun problem in our country. We need to act on them quickly.”
Republican presidential candidate Ben Carson agreed that “racial-based hate is still very much alive as last night so violently reminded us.” But the statement on his Facebook page also called on Americans to rise above hatred more generally and on the basis of differences other than race.
“But I worry about a new hate that is growing in our great nation. I fear our intolerance of one another is the new battle ground of evil. Today many feel it is OK to hate someone who thinks differently than you do. The left hates the right. The right hates the left. This attitude is poison. Poison that will sicken all of us.”
The number of hate crimes reported to the U.S. Department of Justice has been on the decline in recent years. Racially motivated hate crimes have declined steadily, from a high of 4,042 in 2004 to 2,871 in 2013.
Mr. Pinckney, 41, was a married father of two who had served in the South Carolina state legislature since becoming the youngest member of the House when he was first elected as a Democrat at 23.
“He had a core not many of us have,” said state Sen. Vincent Sheheen, who sat beside Mr. Pinckney in the Senate. “I think of the irony that the most gentle of the 46 of us — the best of the 46 of us in this chamber — is the one who lost his life.”
Sylvia Johnson, a cousin of Mr. Pinckney’s, told NBC News that a survivor said the gunman reloaded five times.
Eight people died at the scene, Charleston Police Chief Greg Mullen said. One person died on the way to the Medical University of South Carolina.
The other victims were identified 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.
When the first report of fatalities reached Charleston County Coroner Rae Wooten, “Immediately, my heart started to sink, because I knew that this was going to mean a forever impact on many, many people,” she said.
Ms. Sanders had recently graduated from Allen University. Ms. Hurd worked for Charleston County’s library system for 31 years. Ms. Doctor was an enrollment counselor at Southern Wesleyan University’s Charleston campus, according to a friend.
Ms. Wooten said autopsies would be conducted over the next several days and did not have specific information on how many times the victims were shot or the locations of their injuries.
Mr. Meek and Ms. Konzny said they instantly recognized Mr. Roof on Thursday morning upon seeing surveillance camera footage from the church. Mr. Meek had seen his friend earlier Wednesday, and the two said Mr. Roof had worn the same sweatshirt while playing Xbox video games in their home.
“I don’t know what was going through his head,” Ms. Konzny said. “He was a really sweet kid. He was quiet. He only had a few friends.”
Mayor Joseph P. Riley Jr. had different words, calling the attacks “pure, pure concentrated evil.”
Stunned community leaders and politicians condemned the attack on Emanuel AME Church, and Attorney General Loretta Lynch said the Justice Department has begun a hate crime investigation.
Flowers began to decorate an impromptu memorial Thursday at a police barricade outside the church.
Pastor Thomas A. Dixon, a civil rights activist and community organizer, urged the city’s black residents to “keep your emotions under control.”
“We’ve been consistently putting forward a message of remain reserved and stay calm,” said Mr. Dixon, who participated in an afternoon prayer vigil at Morrison Street Baptist Church, a few blocks from Emanuel AME.
Mr. Dixon called the attack “senseless” and a “horrific crime,” but he said the violence was not a new phenomenon and stressed that similar attacks have targeted groups other than blacks.
“It is a crime that has happened in Jewish synagogues, Buddhist temples, Catholic churches and movie theaters, and now it has come to Charleston to this AME church,” he said.
The Rev. Donte Hickman, a Baltimore pastor who happened to be in North Charleston when the shootings happened, said the “heinous” crime needs to be taken as a sign that churches need to take a stand on gun control and combat the “systemic evil and oppression” that exists inside America.
“I think that the church now is being drafted into this fight for common-sense gun reform and policies that make us safe,” he told The Washington Times. “We don’t want anyone to die, but we do know that all things have a purpose.”
Mr. Obama also spoke with frustration at the level of gun violence in the U.S., and said policymakers must act sooner or later.
“Communities like this have had to endure tragedies like this too many times,” Mr. Obama 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.”
He went on: “Let’s be clear. 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. It doesn’t happen in other places with this kind of frequency. At some point, it’s going to be important for the American people to come to grips with it.”
Vice President Joseph R. Biden, who led earlier administration efforts to impose stricter gun regulations, said the church shootings should compel the country to act.
“As a nation, we must confront the ravages of gun violence and the stain of hatred that continues to be visited on our streets, in our schools, in our houses of worship and in our communities,” Mr. Biden said in a statement with his wife, Jill. “Hate has once again been let loose in an American community.”
The Bidens saw Mr. Pinckney less than a year ago at a prayer breakfast in Columbia, South Carolina, and called him “a good man, a man of faith, a man of service.”
Since losing an effort in Congress to impose background checks on gun purchases in 2013, Mr. Obama has not made another broad, high-profile push for gun regulation.
The president highlighted the racial aspect of the killings, saying the fact that the shootings took place in a black church “also raises questions about a dark part of our history.”
“This is not the first time that black churches have been attacked,” Mr. Obama said. “We know that hatred across races and faiths pose[s] a particular threat to our democracy and our ideals.”
He said he’s confident that the outpouring of support “from all races from all faiths, from all places of worship, indicates the degree to which those old vestiges of hatred can be overcome.”
Referring to the church’s historic role in the abolition and civil rights movements — Martin Luther King once spoke there — Mr. Obama called the house of worship “a sacred place in the history of Charleston and in the history of America.”
Mr. Obama spoke to South Carolina Gov. Nikki Haley and the state’s two Republican senators, Lindsey Graham and Tim Scott, while flying on Air Force One to California, where he’ll attend three Democratic fundraisers with wealthy donors, including one hosted by actor Tyler Perry.
The White House said the president “offered sincere condolences” and pledged any federal resources necessary for the state.
• Dave Boyer reported from Washington. Maggie Ybarra also contributed from Washington to this article, which is based in part on wire service reports.