The governor of Alabama ordered Confederate flags removed from the grounds of the Southern state's Capitol building, his office said on Wednesday, joining a growing movement of politicians to spurn the emblem widely associated with slavery.

"This is the right thing to do," Gov. Robert Bentley said in a statement that came a week after the massacre of nine black worshippers at a Bible study session in a historic African-American church in Charleston, South Carolina.

The flags located around the Confederate Memorial on the state capitol grounds in Montgomery were taken down on Wednesday morning.

Bentley's press secretary, Yasamie August, said the governor made the decision because he did not want the flags to be a distraction from other state issues.

The Civil War-era flags of the South's pro-slavery Confederacy have become a lightning rod for outrage after the shootings last week at Emanuel African Methodist Episcopal church in Charleston, which authorities say was motivated by the gunman's racial hatred.

Dylann Roof, a 21-year-old white man charged with nine counts of murder for the killings, had posed with a Confederate battle flag in photos posted online with a racist manifesto.

The Confederate flag controversy is the latest flashpoint in a year of intense debate over U.S. race relations, sparked by the killings of unarmed black men by police officers in Ferguson, Missouri, New York City and Baltimore. The outcry has reinvigorated the civil rights movement under the banner "Black Lives Matter."