CHARLESTON, S.C. - 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 Storm Roof, 21, of Columbia, 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 captured 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.

"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.

A Snapchat video taken shortly before the shooting and obtained by 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, 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 purchasing it himself with birthday money.

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.

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

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 a still shot 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 world views: 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 "1-800" 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.

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."

"We woke up today, and the heart and soul of South Carolina was broken," South Carolina Gov. Nikki Haley 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 sits 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, called the shooting an "act of pure evil and hatred."