JOHANNESBURG — It seemed like a throwback to the days when a white minority ruled South Africa. Inside a colonial-era courthouse that was once a stage for the political trials of anti-apartheid activists, a white lawyer in robes and frilly bib accused a black leader of being a Communist and fomenting hatred of whites.

“Do you know who Vladimir Lenin was?” demanded the lawyer, rekindling memories of the anti-Communist measures that helped crush dissent during apartheid.

In his defense, the black leader in the dock championed his right to lead his supporters in singing a song with the seemingly bloodthirsty line “Shoot the Boer!” — a historical reference widely taken as a threat by Afrikaners, the descendants of Dutch settlers and the creators of apartheid.

Of course, that racist system ended 17 years ago with Nelson Mandela’s election. The African National Congress has been the governing party ever since. But the past is not really past here. Race remains a fraught issue, riveting the country in recent weeks as the hate-speech trial of Julius Malema, the leader of the party’s youth wing, was broadcast live on television. Closing arguments are expected within weeks.