The black director of South Carolina's public safety agency said Monday he was surprised a photo showing him helping a white man wearing a racist T-shirt went viral. But now that it has, he is hoping it will be a catalyst for people to work toward overcoming hate and violence.

Leroy Smith said in a statement that the photo, taken at a Ku Klux Klan rally, captured "who we are in South Carolina" and represents what law enforcement is all about: helping people "regardless of the person's skin color, nationality or beliefs."

"I consider myself like every other officer who was out there braving the heat on Saturday to preserve and protect," he said.

The photo, taken by Gov. Nikki Haley's spokesman, shows Smith leading the unidentified man, who is suffering from the heat, to shade at the top of the Statehouse steps, to be treated by local emergency workers. The man has a swastika on his T-shirt.

The photo shows just the hand of black Columbia Fire Chief Aubrey Jenkins, who also was assisting the man.

"I hope this photo will be a catalyst for people to work to overcome some of the hatred and violence we have seen in our country in recent weeks," Smith said.

The North Carolina-based Loyal White Knights of the KKK scheduled a rally to protest the removal of the Confederate battle flag from Statehouse grounds a week earlier. State officials gave the group permission to rally on the opposite side of the building from where the flag flew on a 30-foot pole for the past 15 years.

A Florida group affiliated with the New Black Panther Party was given permission to hold a rally on the side where a monument to Confederate soldiers still stands. The rallies overlapped, and tensions escalated.

The Department of Public Safety estimated the crowd, including both groups and spectators, at roughly 2,000 people at its peak. Five people were arrested for assault and battery, disorderly conduct or breach of peace.

Officers from six other state and local law enforcement agencies, in addition to the Department of Public Safety, were present for the dueling rallies.

Gov. Nikki Haley called for the flag's removal, and the Legislature voted to send it to a museum after nine parishioners of a historic black church in Charleston were slain, including its pastor, Sen. Clementa Pinckney. A 21-year-old old white man seen in photos with the Confederate flag is charged with the slayings.