The man suspected of carrying out a mass shooting at a historic black church in Charleston, South Carolina, pleaded not guilty to 33 federal charges, including hate crimes, firearms violations, and obstructing the practice of religion.

The suspect, 21-year-old Dylann Roof, was already indicted on nine murder charges, three attempted murder charges, and one weapons offense at the state level, according to USA Today's John Bacon.

Roof wants to plead guilty to the federal charges, but his lawyers are pleading not guilty until they find out whether federal prosecutors will seek the death penalty, NBC News's James Novogrod and Terry Pickard reported.

On June 17, Roof allegedly walked into the Emanuel African Methodist Episcopal (AME) Church and, after sitting for some time with the congregants, purportedly shot and killed nine people — in what some officials have described as a hate crime. Three others escaped.

Roof has a racially charged history. Police said Roof made racially inflammatory statements before leaving the church's Bible study room, according to the Guardian's Raya Jalabi. A manifesto that appears to be written by Roof is laced with racism. A Facebook picture shows Roof wearing a jacket depicting the flags of racist regimes in Africa, including apartheid South Africa and Rhodesia. And Roof's roommate, Dalton Tyler, told ABC News's Emily Shapiro, "He was big into segregation and other stuff. He said he wanted to start a civil war. He said he was going to do something like that and then kill himself."

Charleston Police Chief Greg Mullen described the shooting as a "hate crime," saying it was "the worst night of my career … clearly a tragedy in the city of Charleston."

A white gunman shot and killed nine people at a black church

Eight people were killed inside the church, and a ninth victim died in the hospital.

Police said the suspect was at the church for nearly an hour before the shooting.

#Charleston PD Chief: shooter attended meeting at Emanuel AME, was there nearly an hour before #CharlestonShooting. @nprnews — Sarah McCammon (@sarahmccammon) June 18, 2015

The local coroner identified all the victims. Here's the list from the Post and Courier's Andrew Knapp:

Clementa Pinckney, 41: state senator, church pastor, and rising star in the South Carolina Democratic Party

Cynthia Hurd, 54: St. Andrews regional branch manager for the Charleston County Public Library system

Sharonda Coleman-Singleton: a church pastor, speech therapist, and coach of the girls' track and field team at Goose Creek High School

Tywanza Sanders, 26: who had a degree in business administration from Allen University

Ethel Lance, 70: a retired Gilliard Center employee who previously worked as the church janitor

Susie Jackson, 87: Lance's cousin and a longtime church member

DePayne Middleton Doctor, 49: who retired in 2005 as Charleston County director of the Community Development Block Grant Program

Mira Thompson, 59: a pastor at the church

Daniel Simmons Sr., 74: who died in a hospital operating room

Roof's family released a statement saying they were "devastated and saddened by what occurred," ABC News reported.

NEW: Family of alleged gunman in Charleston church massacre: "We are devastated and saddened by what occurred." pic.twitter.com/LXN7GdluxS — ABC News (@ABC) June 19, 2015

Roof's trial has already run into some problems: The South Carolina Supreme Court ordered a new judge to preside in the case as revelations surfaced that the previous judge had made racist remarks in the courtroom more than a decade ago, NBC News's Elizabeth Chuck and Erika Angulo reported.

The shooting occurred at a historically significant black church

Emanuel describes itself as "the oldest AME church in the South." AME stands for African Methodist Episcopal Church, a predominantly African-American denomination of Christianity.

As the Washington Post's Sarah Kaplan explained, Charleston's Emanuel AME Church was started in 1816 by Morris Brown, a founding pastor of the African Methodist Episcopal Church, who was fed up with the racism he encountered in other churches in the area.

The church hosted some of the prominent black activists of the time. Denmark Vesey, a founding member of the church, at one point attempted to lead one of the nation's most famous failed slave uprisings, which would have involved more than 9,000 black slaves. But the revolt was foiled when several slaves turned Vesey in, leading to his capture, a trial, and hanging.

White leaders blamed the attack on the Emanuel AME Church, saying it helped foster the attacks. They instituted harsh laws against black churches, including a ban on all-black services. The congregation was then dispersed, and the church was burned. (The congregation would continue to meet in secret.)

In many ways, the Emanuel AME Church's experience represented the history of black churches in general: it was used to evade the systemic racism of the era, and it was attacked by white leaders who wanted to keep their racist policies in place. "That is a microcosm of how and why churches have become targeted," Gerald Horne, a civil rights historian at the University of Houston, said.

Local officials called the shooting a hate crime

The mayor and police chief described the mass shooting as a hate crime.

"The only reason someone would walk into a church and shoot people that were praying is hate,' said Charleston Mayor Joe Riley. — Saeed Ahmed (@saeed_ahmed) June 18, 2015

But South Carolina is one of six states — along with Arkansas, Indiana, Georgia, Utah, and Wyoming — that has no hate crime penalty law at the state level, according to the Anti-Defamation League.

Federal law, which does apply to South Carolina, penalizes hate crimes. But these cases require federal law enforcement to get involved and proceedings in federal courts, which deal with far fewer criminal cases than state courts. It typically takes high-profile cases to get the feds' attention to investigate an act as a hate crime, as the FBI has said it's doing in the Charleston shooting.

When a hate crime is prosecuted, it's typically layered on top of other charges, adding criminal penalties. So if someone commits a murder and it's deemed a hate crime, he faces criminal penalties for both the murder and the hate crime. The extra penalties are supposed to deter and punish people for acts against certain groups of people.

As ThinkProgress's Aviva Shen reported, State Rep. Wendell Gilliard, who represents the district where the Charleston church is located, has worked to pass a hate crime law in South Carolina. But his efforts have been unsuccessful — leaving the state as one of the few without extra penalties for racially motivated attacks.

The Charleston shooting follows a long history of attacks on black churches

Attacks on black churches were a common occurrence throughout the 19th and 20th centuries, including a wave of firebombings of black churches in the South in the 1990s and a burning of a black church in Massachusetts the day President Barack Obama was inaugurated, as the Atlantic's Conor Friedersdorf reported.

Civil rights groups during the early 1960s actively targeted Birmingham for protests, knowing that the city — and the state of Alabama as a whole — was a hub for white supremacy groups and supporters of segregation. The backlash was fierce: KKK members routinely called in bomb threats — and others detonated homemade bombs — to disrupt civil rights meetings and church services. The anger eventually led to one of the most well-known terrorist attacks of the civil rights movement.

On September 15, 1963, a bomb detonated at the predominantly black 16th Street Baptist Church in Birmingham. About 200 people were in the building, according to History.com, many attending Sunday school. Four black girls died, and at least 20 others were injured.