South African President Jacob Zuma on Saturday denounced what he called the "demon of racism" following a slew of discriminatory insults on social media.
Speaking to a stadium of supporters at the annual birthday celebration of the ruling African National Congress, Zuma said "a tiny minority" of South Africans still longed for the days of apartheid white minority rule.
"It is clear that there is a tiny minority in our country that still harbours a desire for separate amenities and who idolise apartheid era leaders," he said at the stadium in Rustenburg in the North West province.
"These people do not represent the true character of the new South Africa. They are living in the past."
His comments come at a time of heightened tensions in the country after several South Africans aired racist views online.
On Tuesday, the ANC, in power since the country's first democratic elections in 1994, launched legal action over a white realtor's Facebook post that compared black beachgoers to monkeys.
The party also targeted a white economic analyst who wrote on Twitter of a growing "sense of entitlement and hatred towards minorities" in South Africa.
A black local government employee was suspended from his position on Friday after posting that South Africa should be "cleansed" of whites, saying "we must act as Hitler did to the Jews".
"We call on all people of this country to work together and defeat the demon of racism and tribalism," said Zuma.
The ANC has said it will pursue the criminalisation of racist comments.