On the edge of this rural town, poor blacks have been moving into a line of new tin shacks across the road from an affluent white enclave. Now, the whites are taking action. “For Sale” signs are posted on many of their large brick houses.

“The white people are running away,” said Sara Letsie, who moved into her shack two months ago. “They don’t want to be our neighbors.”

Lea Victor is one of the few whites remaining in the neighborhood. “They are afraid of the blacks on the other side,” she said, pointing one by one toward five of her neighbors’ houses. “All of them are selling. They have started to take their stuff out.”

When Nelson Mandela became South Africa’s first black president in 1994, one of his biggest challenges was bringing his ideals of reconciliation, tolerance and forgiveness to hundreds of conservative, white-run towns. In rural areas, where 40 percent of the country’s population lives, the apartheid system of racial segregation was deeply entrenched, more so than anywhere else in the nation.

At the time, many believed that reforming the countryside would be a major test of whether South Africa could heal the wounds of apartheid.

Mandela, who died Dec. 5 at 95 and will be buried in his childhood village of Qunu on Sunday, leaves behind a rural landscape where the lives of many blacks have improved. Political power is in their hands. A race war between blacks and whites, predicted by many during the transition from white rule, never erupted. Whites have not fled in huge numbers.

But racial equality remains elusive in Ventersdorp and other rural areas. Whites and blacks are still socially isolated from each other. Racism persists, often below the surface but visible in the divided geography of the area. Both blacks and whites in Ventersdorp, in discussions this past week, expressed concerns about the future in a post-Mandela nation.

“There are people who still don’t want to accept the change, even today,” said Velaphi Qankase, 39, a town official with the ruling African National Congress party. “Us blacks, we are the victims. But we accept the change. But the people who oppressed you before, when you call for peace, it becomes difficult when they don’t accept that.”

Ventersdorp was notorious for being the home of the white extremist Afrikaner Resistance Movement, known by its acronym, AWB, in the Afrikaans language. In the 1980s and 1990s, the neo-Nazi paramilitary group organized large rallies against reforms in apartheid laws. It assaulted blacks and liberal whites, staged assassinations and forced blacks from their homes in nearby Tshing township, built during apartheid to house blacks serving Ventersdorp’s whites.

In the months before the all-race 1994 elections that brought Mandela and the African National Congress to power, AWB militants launched a bombing campaign that killed 21 people and injured dozens more. Even after the elections, Ventersdorp was known for its refusal to embrace the new South Africa.

In 1995, Ventersdorp elected its first black mayor, and the town council was mostly black. New laws forbade segregation. But right-wing whites barred blacks from white-run hotels, bars and the local pool. The Golf Club admitted black members only nine years ago.

The AWB’s leader, Eugene Terre’Blanche, often railed against Mandela and the ANC. Victor recalled how many whites referred to Mandela by a racist slur widely used by white Afrikaners during apartheid. Terre’Blanche, who was jailed for three years for assaulting a black gas station worker, was hacked and beaten to death in 2010 by a black farm laborer, allegedly in a dispute over wages.

The AWB still keeps its headquarters in Ventersdorp. But the movement has become fractured, and membership has declined.

Today, blacks live in town and are free to eat and drink anywhere, and they go to school with whites. But as in most parts of the country, whites still dominate the local economy. Whites own nearly all of the most lucrative farms around Ventersdorp, with blacks working as their laborers or servants.

The white community is a meld of liberals and conservative Afrikaners, many of whom mourned the death of Mandela.

At the Dutch Reformed Church, which preached that blacks were inferior but in 1992 declared apartheid a sin — congregants bowed their heads in silence and listened solemnly as Mandela was described as a man who taught Afrikaners about the importance of reconciliation. Many whites feared that Mandela would be so bitter that he would seek revenge after spending 27 years imprisoned by the white government.

“I don’t think there was any better person that could have taken our country into a new democracy than Mandela,” said Alan Jones, a white farmer and local politician. “The transition, and everything else, went smoothly. It was the opposite of what many expected to happen.”

“Without Madiba, maybe some of us might not be alive now,” said Qankase, referring to Mandela by his Xhosa clan name. “It would have been whites fighting against blacks.”

Other whites remain attached to a bygone era.

At an Afrikaner church that many AWB members and other conservative whites attend, pastor Francois De Bruin made no mention of Mandela last Sunday. Instead, he said in an interview, he preached Genesis 3, about the sins of man.

Like many whites here, he complained about rising crime rates, noting that more and more white farmers are being killed. Policies meant to empower blacks, he said, have deprived whites of jobs, creating small pockets of impoverished whites in the town. He also railed against the poor quality of municipal services.

“What’s the struggle for the whites today? What’s the struggle for the coloreds?” De Bruin said, referring to mixed-race people. “They are really not black enough. You still don’t have a Mandela solution. His being alive didn’t help. His being dead will only make things worse. “

Blacks say they no longer fear attacks or evictions by white extremists. But many still don’t enjoy, or can’t afford, the same privileges as whites. A private primary school, the town’s best, is all-white because few blacks can afford the fees. Only two of the 65 members of the Golf Club are black. And blacks say whites still move to the front of the line in stores.

Blacks and whites say they never socialize with each other. At restaurants, it’s rare to see people of different races sitting together. That is true in other South African towns and cities as well. Less than 40 percent of South Africans interact socially with people of another race, according to the SA Reconciliation Barometer, a public opinion poll on race, political and social relations.

“I have no white friends,” said Tommy Lerefolo, a black municipal official.

Many blacks still depend on whites for jobs in Ventersdorp. But black residents and community leaders say many have been fired and evicted from white-owned farms since Terre’Blanche’s murder. White community leaders deny that. “We don’t employ a lot of blacks anyway. Because they steal,” De Bruin said.

ANC officials are still struggling to redress the inequalities of apartheid. In Tshing, electricity, clean water and other basic services have improved. A few thousand houses have been built, but more are needed. Officials plan to relocate more than 1,100 families to the edge of Ventersdorp, essentially joining it with Tshing.

“Madiba would have been happy,” Qankase said

Whites have objected to the proposal, and some have expressed concern that with Mandela dead, blacks will attack them. In some parts of town, white residents said they have seen a video, circulated by a conservative church in recent months, that warns that blacks will rise up to slay whites after Mandela’s death, fanning fears.

“The blacks are going to cause problems now,” said Steven Naude, 25. “If you got money, they will try to attack you. We don’t know what is going on in the heads of blacks.”

ANC officials call such attitudes paranoia. “If we do that, we cancel the legacy of Mandela. He stood for unity and peace,” Qankase said. “It will never come down to that.”