African-American Christians in Charleston, S.C., taught the world an extraordinary lesson last week by answering the heinous acts of a hate-filled murderer with words of grace, forgiveness and compassion. And, in the process, they ignited a remarkable spirit of unity among South Carolinians of all colors and faiths. The killer’s hope of starting a race war produced instead a massive embrace.

On Monday in Columbia, that same spirit moved Republican Gov. Nikki Haley to do the unthinkable. Surrounded by leaders from both parties, she proclaimed her intent to remove the Confederate battle flag from the capitol grounds. The state Legislature should promptly comply. As Haley said, the rebel flag is a “deeply offensive symbol of a brutally oppressive past.”

That’s an abrupt turnabout for the governor and many of the state’s Republican officials, most notably Sen. Lindsey Graham, a presidential contender. In the Deep South, and perhaps most pointedly in history-steeped South Carolina, the flag represents an emotional link to bygone days and a commemoration of Civil War ancestors who died defending “states’ rights.”

That dreamy version is little more than romantic fiction, however. The state’s right that Southerners wanted most to preserve was slavery. Indeed, white supremacy was the Confederacy’s founding principle, as noted infamously by Vice President Alexander Stephens in 1861: “Our new government rests upon the great truth that the Negro is not equal to the white man; that slavery — subordination to the superior race — is his natural and normal condition.”

On Monday, Haley spoke as if the rebel flag had only recently been hijacked by the “sick and twisted,” an obvious reference to 21-year-old Dylann Roof, who posed with the flag and wore a jacket adorned with the flags of apartheid South Africa and Rhodesia before allegedly embarking on his murderous act in a Charleston church. But, in fact, the Confederate battle flag has long been a defiant symbol of racism and ignorance — as well as denial of the region’s tragic past.

The flag, not widely employed in any official capacity during the 75 years following the war, was revived in 1938 and displayed in the State House in defiance of Congress’ attempt to make lynching a federal crime. In 1962 it rose to share the top of the capitol dome, largely as a symbol of resistance to civil rights advances. In 2000, after years of emotional debate, it was relegated to the capitol grounds. Now, if legislators summon the courage and the required two-thirds majority, the flag should find its proper place in museums and, as Haley noted, on the private property of those who choose to fly it.

More worrisome than any piece of cloth, however, is the virulent fuel that appears to have driven Roof toward his alleged crime — Internet sites that have become, in effect, virtual terror groups bent on sowing hatred and violence. Impressionable young men seem particularly vulnerable, whether the message is white supremacy or Islamist extremism. It is one of the more frightening consequences of the Information Age, and a problem with no apparent solution.

For the moment, hauling down the flag in South Carolina would be progress enough. Those calling for its removal should be careful not to overreach, however. Demanding that every Confederate war memorial in every town square in the South be taken down would invite a terrible backlash, and rightly so. Not every reminder of a complex and tragic past should be erased from memory. We are not a totalitarian country. Where would one stop? Renaming Lake Calhoun in Minneapolis because it carries the moniker of an antebellum politician would be a stretch. Closing the Jefferson Memorial because its namesake was a slaveholder would be way out of bounds.

So far, the Palmetto State has set exactly the right tone on these matters. As visitors to Charleston and the Low Country can attest, South Carolinians take justifiable pride in preserving genteel hospitality and good manners. That alone should move the Legislature to take down a flag that’s so deeply offensive to many citizens, black and white.