Authorities arrested a lone high school dropout in connection with the slaying of a prominent minister and eight parishioners in the South’s oldest African American church and were working Thursday to determine a motive for the shooting.

The alleged gunman, Dylann Roof, 21, of Eastover, S.C., reportedly declared his hatred for black people before opening fire on a Bible study group at the church late Wednesday, federal law enforcement officials said.

Agents were continuing to interview witnesses, including one woman who survived the slaughter. Roof allegedly released her, one law enforcement official said, so she could tell others what had happened.

After a tense overnight manhunt, Roof was nabbed about 250 miles to the north in Shelby, N.C., after a local florist said she recognized him and his car from news reports. The slaying, which is being investigated as a hate crime, horrified the nation and revived fears about the persistence of racial hatred.

At a White House news conference, President Obama expressed “sadness and anger” at the violence, as well as impatience with the refusal of lawmakers to tighten the nation’s gun laws.

Read the victims’ stories

“Once again innocent people were killed because someone who wanted to inflict harm had no trouble getting their hands on a gun,” Obama said. “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.”

The shooting occurred late Wednesday in downtown Charleston at Emanuel African Methodist Episcopal Church, one of the oldest black churches in the nation. According to authorities, the gunman — a skinny white man with a distinctive mop of sandy hair — walked in about 8 p.m. and was invited to sit with parishioners at their Wednesday-night Bible study session.

A Snapchat video taken shortly before the shooting and obtained by Mashable.com appears to show a white man sitting with the black parishioners around a table in a church meeting room.

Law enforcement officials, who spoke on the condition of anonymity to discuss an ongoing investigation, said the man sat silently for about an hour, declining to join the discussion.

Instead, around 9 p.m., he abruptly announced that he had come to kill black people. Then he opened fire. When Roof was arrested, he had a Glock .45-
caliber semiautomatic handgun that law enforcement officials said he had obtained in April, either receiving it as a birthday gift or buying it himself with birthday money. The gun was purchased legally, officials said.

Witnesses told authorities they never saw the man pull out the gun. Instead, they saw him start shooting, up close, targeting each victim with precision. The man took the time to reload the handgun “several times,” officials said.

Dylann Roof is in custody after police say he opened fire at a historic African American church in Charleston, SC. Here’s a look at the 21-year-old's background, including recent arrests, and what authorities say happened inside the church. (Alice Li/The Washington Post)

Afterward, eight people lay dead and a ninth lay dying. Among the victims was the Rev. Clementa Pinckney, 41, Emanuel AME’s charismatic pastor, who also served in the South Carolina Senate.

Authorities identified the other victims as the Rev. Sharonda Coleman-Singleton, 45, who is the mother of a Charleston Southern University student; Cynthia Hurd, 47, the manager of the St. Andrews Regional Library in Charleston; Susie Jackson, 87; Ethel Lance, 70; DePayne Middleton; Tywanza Sanders, 26; and Myra Thompson, 59. Daniel Simmons, 74, died at the hospital.

Through the night, authorities combed the streets of Charleston, but they found no trace of the gunman other than a chilling image captured by a church security camera. They released a description and an image from the video.

When Roof’s sister saw it on TV, she promptly called police, law enforcement officials said, and gave them her brother’s name.

A troubled loner who dropped out of school in ninth grade and had a history of small-time arrests, Roof maintained a Facebook page that seems to reflect his worldview: The profile picture shows him scowling in a wooded swamp, wearing a jacket with at least two conspicuous patches. According to the Southern Poverty Law Center, which tracks hate groups, the patches depict the flags of old racist, white regimes in southern Africa, including Rhodesia (now Zimbabwe).

Authorities quickly set up a toll-free tip number. At the crime scene, impromptu prayer circles formed, along with huddles of friends asking about the victims and seeking updates from police. News of Roof’s arrest came at 10:49 a.m. Acting on a citizen’s tip, police took him peacefully into custody after a traffic stop.

Charleston Police Chief Gregory Mullen said Roof “was cooperative with the officer who stopped him.”

On Thursday afternoon, Roof wore a bulletproof vest over a white T-shirt as he was led out of the police station in Shelby, N.C. He neither looked at nor looked away from reporters crowded around the station’s back entrance. He waived extradition to South Carolina and was flown back to Charleston late Thursday.

Authorities declined to say whether he had confessed to the shooting, but police said they think he acted alone.

It was unclear why Roof fled to Shelby. His home in Eastover is near Columbia, South Carolina’s state capital, about 130 miles to the south, but his sister’s fiance, Michael Tyo, lives in Shelby.

Wednesday’s shooting was the deadliest attack on a place of worship in the United States since 1991, when nine people were killed at the Wat Promkunaram temple near Phoenix. Johnathan Doody, tried three times for the execution-style murders at the Buddhist temple, was sentenced in 2014 to 249 years in prison.

Carl Chinn runs what is considered to be the most extensive database on violence at houses of worship. He said the shooting was “certainly one of, if not the most, vicious attacks I’ve seen at a faith-based organization.”

For some, the shooting evoked memories of the 1963 Birmingham bombing, in which Ku Klux Klan member planted dynamite on the steps of the 16th Street Baptist Church, killing four African American girls.

“For such a heinous act to be perpetrated in a house of God more than a half a century after the 16th Street tragedy is a reminder to us all that we must be ever vigilant and work as one community to call out and eliminate racial hatred,” said Doug Jones, the former U.S. attorney who prosecuted some of the Klan members.

Remembering the victims

“We woke up today, and the heart and soul of South Carolina was broken,” South Carolina Gov. Nikki Haley (R) said, choking back tears at a news conference. “We have some grieving to do. And we have some pain to go through. Parents are having to explain to their kids how they can go to church and feel safe, and that’s not something we ever thought we’d have to deal with.”

Pictures from the South Carolina State House showed a black cloth draped at the desk where Pinckney sat in the State Senate. The Confederate flag continued to wave outside.

Vice President Biden, who had seen Pinckney last year at a prayer breakfast in Columbia, S.C., called the shooting an “act of pure evil and hatred.”

“Hate has once again been let loose in an American community,” Biden and his wife, Jill, said in a statement. “And the senseless actions of a coward have once again cut short so many lives with so much promise.”

At a midday service at Morris Brown AME Church, blocks away from the previous night’s massacre, the congregation burst into applause when the Rev. Norvel Goff announced Roof’s capture.

“Some of us haven’t been to bed yet,” Goff said. “But good folk can’t go to sleep when evil is trying to come in.”

Horwitz and Wan reported from Washington. Anne Gearan in Charleston and Ken Otterbourg in Shelby and J. Freedom du Lac, Mark Berman, Lindsey Bever, Sarah Larimer, Elahe Izadi, Jose A. DelReal, Thad Moore, Ishaan Tharoor, Sarah Pulliam Bailey, Brian Murphy and Julie Tate in Washington contributed to this report.

Read more:

●The ugly truth about hate crimes

11 essential facts about guns and mass shootings in the United States