A mass shooting at a historic African-American church in Charleston, S.C. drew prayers and sympathy from the state's Catholics, aghast at the horror of the crime which may have had racial motivations.

"The inside of any church is a sanctuary. When a person enters, he or she has the right to worship, pray and learn in a safe and secure environment," Bishop Robert Guglielmone of Charleston said June 18. "For anyone to murder nine individuals is upsetting, but to kill them inside of a church during a Bible study class is devastating to any faith community."

Bishop Guglielmone offered his deepest sympathies on behalf of all Catholics in South Carolina to the families of the victims and the church members of Emanuel African Methodist Episcopal Church.

"I pray that everyone affected by this horror will feel the comforting presence of our Lord surrounding them during this difficult time."

Bishop Michael Burbidge of Raleigh tweeted: "We pray for those killed in the violent church shooting in Charleston. We also pray for their families and all those who mourn their death."

A white gunman fatally shot three men and six women at the historic black church June 17 after an evening prayer meeting and Bible study. Three people survived.

The shooter sat in the church for almost an hour before he stood up and opened fire.

Local authorities have not publicly identified the victims. Church members, friends, and family told the Charleston Post and Courier that the dead include Pastor Clementa Pinckney, 41, who was also a state senator.

Sylvia Johnson, a cousin of Pinckney, told NBC News that an eyewitness said the gunman sat next to the pastor during the Bible study.

The gunman reportedly told one woman who survived that he was letting her live to tell everyone what had happened, Dot Scott, president of the Charleston NAACP, told the Charleston Post and Courier.

James Johnson, who had become friends with Pinckney through civil rights activism, said the feeling after the shooting was "very numb; it's sad."

"No one expects to go to church to worship their God and be shot dead," said Johnson, a chapter president of the National Action Network civil rights organization.

The alleged shooter, 21-year-old Dylann Roof, was arrested in North Carolina on Thursday.

He had been jailed twice previously on a trespassing charge and a separate controlled substance charge. His Facebook page shows him wearing a jacket with the apartheid-era South African flag and the flag of Rhodesia, USA Today reports.

Local law enforcement and federal authorities are investigating the shooting as a hate crime.

According to Sylvia Johnson, the gunman told the church members "I have to do it. You rape our women, and you're taking over our country."

Hundreds of people gathered at another Charleston African Methodist Episcopal church for a June 18 prayer vigil.

African Methodist Episcopal Bishop Julius Harrison McAllister was among the speakers.

"What crime did they commit? They were guilty of believing because they were in a holy place, no such thing could occur," he said.

Emanuel African Methodist Episcopal Church is the oldest African Methodist Episcopal church in the South.

The church community dates back to before 1816. A founding member, Denmark Vesey, led a slave rebellion in 1822 that resulted in the burning of the church and drove its members underground. The church reorganized in 1865, and hosted a speech by Martin Luther King, Jr. in April, 1962.