When President Barack Obama arrived at his hotel in Oklahoma on Wednesday for a trip in which he will visit a federal prison, some protesters greeted the first black president with a symbol of white supremacy — the Confederate battle flag.

The president previously criticized the flag as a symbol of hate, and he praised the Republican governor and Republican-controlled legislature of South Carolina for voting to take it down from the state's Capitol grounds.

Supporters of the Confederate flag argue that it's a symbol of heritage that honors the dead who fought in the Civil War. But that heritage is mired in racism, and the major cause that those soldiers fought for during the Civil War was slavery, an obviously racist institution. And after a mass shooting left nine dead at a black church in Charleston, South Carolina, last month in what's been characterized as a hate crime, keeping the flag up felt like an insult to many black Americans.

The Confederate flag has always been a symbol of white supremacy and racism

Throughout history, the Confederate flag has been repeatedly used as a symbol to oppress black people. It was flown by Southern armies during the Civil War as they fought to keep slavery. And it was later brought back in the 1960s, as Vox's Libby Nelson explained, to intimidate civil rights advocates and defend segregation.

When states seceded from the union during the Civil War, they explicitly voiced their racist intents. South Carolina, the first state to secede, said in its official statement that it saw any attempts to abolish slavery and grant rights to black Americans as "hostile to the South" and "destructive of its beliefs and safety." Mississippi was even more explicit, stating that its "position is thoroughly identified with the institution of slavery."

These statements leave no doubt that the South fought in the Civil War to protect the institution of slavery. This history is why South Carolina, with the support of Obama, moved to take down the flag. But it also makes protesters' decision to greet the first black president with a Confederate flag seem all the more misguided, even if they didn't have racist intents.