There were physical altercations beyond the barricades, but police officers resolved them quickly. When the protest ended and the white demonstrators began to march away around 4 p.m., state troopers with long guns, as well as a Sheriff’s Department tactical team, helped to clear a path.

It barely worked. Hundreds of Klan critics followed the white demonstrators to a nearby parking garage, and the authorities had to block roads so the protesters could leave. One driver, besieged by a crowd of protesters that ran toward the departing vehicles, crashed into a lamppost.

Some of the white people who circulated in the crowd before the Klan rally said they were drawn to the protests by a blend of curiosity and support for preserving Southern history.

“We’re not allowed to have this as a heritage,” Jerry Anderson, a 49-year-old white man who drove here from northwest Georgia, said as he gestured toward another man’s Confederate battle flag. “But they can fly theirs, and they can say what they want to, and it’s O.K.”

Mr. Anderson said he had never attended a Klan event, adding: “I’ve never had a reason to go to one. But they take that away and holler that we’re the racists, so, yeah, I’m here.”

By attending, people like Mr. Anderson defied Gov. Nikki R. Haley, a Republican, who on Thursday asked South Carolinians to keep “away from the disruptive, hateful spectacle members of the Ku Klux Klan hope to create over the weekend.”

Earlier on Saturday, a rally organized by Black Educators for Justice, a Florida-based group with ties to the former director of the New Black Panther Party, attracted a smaller crowd and a far less conspicuous police presence. Among the speakers was the chairman of the New Black Panther Party, Hashim Nzinga, who made little mention of the June 17 massacre of nine black people at Charleston’s Emanuel African Methodist Episcopal Church. Instead, he argued that blacks must offer renewed and vigorous resistance to what he regards as generations of oppression.