A judge ruled that Mr Malema’s repeated performance of the song was “derogatory, dehumanising and hurtful” to the country’s Afrikaans minority group and had no place in the new South Africa.
Judge Colin Lamont said that if the 30-year-old sings it in future, he faces criminal charges and a potential prison spell.
“People must develop new customs and rejoice in a developing society by giving up old practices which are hurtful to members who live in that society with them,” Judge Lamont, sitting at Johannesburg High Court, said.
“The enemy has become the friend, the brother. This new approach to each other must be fostered.”
The ruling is the latest in a string of setbacks for Mr Malema, who has won support among impoverished blacks with calls for mine nationalisation and forced land redistribution.
He is facing expulsion from the ANC for challenging President Jacob Zuma and is under investigation by the anti-corruption watchdog for allegedly taking bribes for tenders.
The ANC Youth League said Judge Lamont’s decision effectively banned the celebration of “the struggle of the people of the Republic of South Africa”.
But it was welcomed by AfriForum, the Afrikaner rights group which brought the civil case.
“It sends a clear message to Malema that he isn’t above the law and that he can’t sow divisions wherever he goes,” said Kallie Kriel, AfriForum’s CEO.
“These songs change over time to adapt to new circumstances. It’s time that the ANC adapts from being a struggle organisation to a modern political party.”
Mr Malema was not present in court for the ruling but previously argued the song was a liberation anthem and did not refer to individuals but rather the apartheid oppressor in general.
AfriForum argued that with the death toll of white farmers, also known as Boers, at an estimated 3,000 since apartheid’s end in 1994, Mr Malema’s actions were insensitive and cruel.
Judge Lamont said there was no evidence that the youth league president’s actions had contributed to any deaths or injuries.
But he said Mr Malema transformed the song into a staccato chant complete with shooting gestures, and would have been fully aware of how his words might be interpreted and the effect they might have.
Mr Malema was ordered to pay partial costs for the court case. The ANC, which backed its erstwhile youth leader in the hate speech case, said it was “appalled” by the judgement, which it said was an attempt to “rewrite undesirable South African history”.
“This ruling flies against the need to accept our past and to preserve our heritage as an organisation and as a people,” spokesman Jackson Mthembu said.”The ANC will explore every possibility to defend our history, our heritage and our traditions.”