There's renewed debate over the meaning of the controversial Confederate flag following a racially motivated mass shooting in Charleston, S.C.

Dylann Storm Roof, 21, has been charged with murder after allegedly killing nine black church members at the historic "Mother" Emanuel African Methodist Episcopal Church last week. Shortly after the shooting, images surfaced of the alleged shooter, Roof, posing with a Confederate flag.

It has reinvigorated an old debate over whether the flag represents southern pride and a state's right to freedom, or whether it is a racist symbol. The Confederate flag is used by hundreds of extremist groups, including the white supremacist group the Ku Klux Klan, for example.

Not an official confederacy flag

The Confederate States of America, a group of seven states that supported slave ownership in the mid-1800s and wanted to secede from the U.S., did not use the current Confederate flag as its national flag.

The confederacy created a national flag called Stars and Bars made up of seven stars to represent the seven states: South Carolina, Mississippi, Florida, Alabama, Georgia, Louisiana and Texas. It was used from March 1861 to May 1863, according to USFlag.org. Extra stars were added to the flag as more states joined the confederacy.

Stars and Bars Confederate flag

The seven-star Stars and Bars flag was the first official flag of the confederacy. (Bruce Smith/Associated Press)

In May 1863, the confederacy adopted its second official flag, which had 13 stars in the Southern Cross formation to represent additional states. Four new states had officially joined: Virginia, Arkansas, Tennessee and North Carolina. The two extra stars represented Kentucky and Missouri, which were not official members of the confederacy.

About two years later, the confederacy added a red bar at the right-hand side of the flag, its third official iteration.

The Confederate flag that remains in common use in some southern states today was never an official flag of the confederacy. Instead, it was used as a battle flag.

Conflicting opinions

The Confederate battle flag is considered by some to be a symbol of slavery, others of southern pride. 

The Sons of Confederate Veterans, a group that works to preserve the history of the Confederacy, sells multiple items online with the flag printed on them. It says the people who fought for the Confederacy were heroes who wanted to preserve liberty and freedom guaranteed to them by the Constitution, according to the group's website, and that the Confederate flag is a symbol of that belief.

South Carolina Governor Nikki Haley has acknowledged that for many South Carolinians the flag still represents noble traditions of heritage and duty.

However, she also recognized that it is a "deeply offensive symbol of a brutally oppressive past." Millions of Africans were brought in cargo ships to America where they were sold as slaves before the practice was abolished in 1865.

The Confederate battle flag remains a symbol of hundreds of extremist groups in the U.S., including the KKK.

The National Association for the Advancement of Colored People (NAACP) has fought South Carolina's public display of the Confederate battle flag for more than two decades.

South Carolina's display

The Confederate battle flag was originally placed atop South Carolina's Statehouse in 1961 to mark the 100th anniversary of the beginning of the Civil War. Lawmakers decided to keep it there the following year in response to the civil rights movement.

Fifteen years ago, mass protests led the state to remove the flag. It was moved to a position in front of the government building, next to a monument to Confederate soldiers, where it remains today.

South Carolina Governor Haley has called for the flag to be removed following the June 17, 2015, mass shooting that killed nine black church members. Haley said the flag should be placed in a museum.

The governor urged the state's House and Senate to debate the issue no later than this summer, saying she'll otherwise call a special session to force them to resolve it. Any change would need a two-thirds majority in both houses.

Both houses approved a measure to hold the debate. The House measure was approved by a vote of 103 to 10. The debate isn't expected to happen for several weeks.

State flags, seals

Some state flags incorporate aspects of the various Confederate flags into their own.

Georgia's state flag is the original Stars and Bars Confederate flag with Georgia's state seal in the middle of the circle of stars.

Georgia State Flag

The Georgia state flag incorporates the original Stars and Bars Confederate flag. (Ric Feld/Associated Press)

Mississippi incorporates the most well-known Confederate battle flag into its state flag. After the shooting, Mississippi House Speaker Philip Gunn called for the removal of the emblem from the state flag.

Mississippi state flag

Mississippi's state flag, with its Confederate emblem, flies outside the Marshall County Courthouse in Holly Springs, Miss. (Allen G. Breed/Associated Press)

The seal of Texas shows six flags, including a version of the Confederate flag.

Alabama's coat of arms displays the Confederate battle flag.

Licence plates

Several states offer specialty licence plates picturing the Confederate battle flag surrounded by the insignia of The Sons of Confederate Veterans. They include South Carolina, Alabama, Georgia, Louisiana, Maryland, Mississippi, North Carolina, Tennessee and Virginia.

On Tuesday, Virginia Gov. Terry McAuliffe ordered the replacement of such plates in the state. He said the banner is "hurtful" to too many people.

The U.S. Supreme Court recently ruled against the Texas division of the group and allowed Texas to refuse to sell the specialty licence plates.

Confederate flag license plate

The design of a proposed Sons of the Confederacy Texas state license plate. (Texas Department of Motor Vehicles/Reuters)

Confederate flag products

Following the June 17 shooting, several large retailers decided to remove products bearing the Confederate flag from their stores and websites.

Walmart and Sears made the announcement on the same day Governor Haley called on lawmakers to remove the flag from South Carolina's state grounds.

America's oldest and largest flag manufacturer, Annin Flagmakers, announced it would stop making and selling the Confederate flag. The company has been in business since 1847.

Canada's The Flag Shop also decided to stop selling the Confederate flag.

Desecration forbidden

Several states forbid people from desecrating the Confederate flag.

Florida, Georgia, Louisiana, Mississippi and South Carolina all have laws protecting the flag, according to the First Amendment Center.

Pop culture sightings

The Confederate flag makes a number of appearances in popular culture.

Most famously, The Dukes of Hazzard TV show had a car named the General Lee with the Confederate flag painted on its roof (Lee was the Confederate general who adopted the battle flag for the Army of Northern Virginia). The flag also appeared in scenes from the movie Forrest Gump and an episode of The Simpsons.

Primal Scream's 1994 album Give Out But Don't Give Up featured the battle flag on its cover.

Star support

The band Lynyrd Skynyrd, behind the hit Sweet Home Alabama, has used the Confederate flag as part of its stage display for years. It has also appeared on their album art.

In 2012, Gary Rossington defended the band's use of the flag, saying he and all past and present band members are "extremely proud" of their Southern heritage.

"The Civil War was fought over States' rights ..." he wrote on the group's Facebook page. "The Confederate flag means something more to us, Heritage not Hate."

Kanye West Loser.com

Kanye West promoted his 2013 album Yeezus with merchandise emblazoned with the Southern Cross flag and a skull. (Jason Merritt/Getty Images)

Rapper Kanye West came under fire in 2013 when he used the Confederate flag to promote his Yeezus album. Kanye emblazoned the Southern Cross flag, accompanied by a skull, on concert T-shirts, bags and other merchandise. He was also once photographed wearing a jacket with the battle flag on the sleeve. West claimed to be reappropriating the flag with these actions.

Several other rappers from Atlanta, Ga., have also shown the flag as a subversive act, the Washington Post reports. Andre 3000, Lil Jon and Pastor Troy have all used a form of the flag in one of their music videos.

Musician Kid Rock has also used the Confederate flag in his performances.

Canadian controversies

The controversy over the flag's meaning has even crossed over the border into Canada.

hi-hillbillyheaven

Hillbilly Heaven, a downtown Hamilton, Ont., restaurant, sparked controversy by bearing the Confederate flag. (Cory Ruf/CBC)

In 2013, the owner of a downtown Hamilton restaurant displayed the Confederate flag on its three-sided outdoor sign. The owner, Cameron Bailey, claimed he used the flag as part of his display because he wanted to show a "southern icon."

That same year, students at a York Region high school in Georgina, Ont., started carrying items, like backpacks and belt buckles, with the Confederate flag on them, the Toronto Star reported. Sutton District High School ultimately banned the flag after a two-year battle with students who mostly said it represented country values to them. The school also implemented programs to educate students about racism. One year later, four teens were charged with assault after a black student at the school was beaten while onlookers yelled racial slurs.

With files from the Associated Press and Reuters