The clash erupted in the afternoon as California Highway Patrol and Sacramento police officers were escorting about 35 members of the South Africa Project to a parking garage following their protest outside the Capitol building.
About 50 members of Occupy Oakland began throwing cans and bottles at the South Africa group and at the officers. The Occupy members then rushed the officers as people with the pro-whites group hurried into the parking garage.
CHP spokeswoman Fran Clader said the two officers suffered minor injuries and were taken to a hospital. The CHP arrested three Occupy members on suspicion of disobeying and officer.
One CHP officer was injured when a member of the Occupy group jumped on him, and another was hurt after being struck by an object.
The violence abated after a large contingent of law enforcement arrived at the scene, about a block from the Capitol.
The clash followed a tense afternoon during which peace officers kept the two groups separated outside the Capitol.
Members of the South Africa Project were trying to draw attention to what they said is black-on-white violence in that country. Organizers said similar demonstrations were planned in other states and elsewhere in California.
The group was mostly male and white, some with shaved heads and prominent tattoos.
Many of the Occupy protesters, some wearing hoods or masks, said they came from the San Francisco Bay area to counter what they called a racist group affiliated with former Louisiana Ku Klux Klan leader David Duke.
Occupy protesters had been cursing at the South Africa Project rally and at officers keeping the two sides apart.
Ryan Stark, 26, who said he is part of Occupy Sacramento, said he joined the protesters challenging the South Africa Project protesters because there needed to be a showdown.
"I didn't throw anything ... but these sorts of demonstrations need to happen," he said, referring to the counter protest. "They do have the right to say what they want, but we're not going to let it fly."
The public was being kept away from the scene of the confrontation by police officers, who were not commenting to reporters. The city's light rail system was stopped through the section of downtown where the clash occurred, and commuters were not allowed to leave the area.
Neither the CHP nor the Sacramento Police Department immediately responded to telephone messages.
Earlier in the day, a teenage girl with Occupy Oakland was taken to Juvenile Hall after she became combative and assaulted an officer who asked her to pick up litter, California Highway Patrol Officer Sean Kennedy said. He did not have her age or city of residence.