WELKOM, SOUTH AFRICA -- Whites and blacks in this rich, racially charged gold-mining town have found a way, after months of ugly and at times deadly confrontations, to open direct talks.

"We started talking to each other. A lot of good has come out of that," said William Odendaal, Welkom's outgoing mayor. "The situation is not normalized, but it's much better than it was."

It is a lesson that thousands of small white farming and mining communities scattered all across South Africa's platteland, or flatland, are waiting to learn as they struggle to adjust to the legalization of anti-apartheid organizations. The new situation has touched off an explosion of black "protest politics" and equally intense reverberations of fear among whites, particularly those who live in the countryside.

Learning how to talk to militant blacks has not come easily for whites here. Last spring, Welkom became South Africa's most publicized case of white bigotry as it called out right-wing vigilantes to respond to changes brought about by President Frederik W. de Klerk's legalization of black anti-apartheid groups in February.

Many whites here at first welcomed the Blanke Veiligheid (White Security), a group of gun-toting, right-wing Afrikaner vigilantes. Television crews from all over the world came to film the vigilantes on patrol, running blacks out of town after dark.

But after the deaths of four white townspeople and three white miners, after two costly consumer boycotts and several black marches into downtown Welkom, the vigilantes have disappeared from the streets and their White Security organization has become discredited and appears inactive.

Now, white leaders from Welkom and black activists from Thabong, a black township on Welkom's eastern outskirts, are sitting across a table, through negotiation and compromise, to work out a new local order acceptable to both sides.

The Welkom town council has been holding meetings with the Thabong township council as well as with a grass-roots civic association to discuss such basic issues as housing, rent payments, electricity and service fees for water and garbage collection. A forum of representatives from various black and white groups has also been established to deal with black grievances and white fears.

"It sounds trite, but it's really quite difficult. People were asked to talk to each other," said Richard Solms, manager of the President Steyn gold mine, just outside of town, where two whites were killed.

Solms is overseeing meetings between white and black union officials. Whites are hearing for the first time from their black counterparts what "300 years of racial discrimination" in the mines" means to them, said black union officer Senzeni Zokwana.

The black reaction to all this sudden attention from the white community seems to be a mixture of jubilation and skepticism.

"It shows protest politics work," said Vakele Mayikeso, an activist in another nearby township.

But a top ANC official in Thabong, Tsiu Mtsepe, said he felt Welkom's whites were just starting to come to grips with the changes underway and are still in a state of shocked disbelief.

He cited as one example a recent experience he had in cashing an ANC check for 41 rand at a local bank. The women teller became so flustered at seeing the words "African National Congress" on the check that she paid out 410 rand instead, he said.

"They still can't believe it," he remarked.

Odendaal, a liberal by Welkom standards, was one of three whites who took it upon themselves to try to prevent Welkom from becoming a racial battleground. The two others, both new arrivals in Welkom, were a Methodist minister, the Rev. Gavin Graham, and the local police commander, Col. Hennie Heymens.

"There was only one thing we could do, and that was talk," Heymens said in an interview, in which he talked proudly of his "open-door policy" and stepped-up efforts to improve relations with the black community. He has given out his phone number to everyone, he said, so "if there is trouble, you can phone me at any time."

By all accounts, a consumer boycott last March by Thabong's 350,000 black residents got the three men involved in trying to build bridges across the yawning gap between the two communities.

Odendaal made a secret trip into Thabong to contact its militants to discuss the boycott. Graham brought together white and black leaders, and Heymens fought to keep the peace impartially.

The boycott threatened Welkom's white merchants with disaster and brought to the fore the town's toughest Afrikaner racists, who in early March formed the White Security vigilantes. The group's main activity was policing the white suburbs to make sure no blacks were on the streets after 8 p.m. One black man was killed and at least five injured in Welkom during the first two months of vigilante patrols.

Graham, an outsider just transferred from a church in Port Elizabeth, arrived here as the March boycott was about to get underway. Immediately alarmed, he began asking white and black leaders to join discussions on the looming crisis.

Blacks wanted an end to the harassment on the streets by White Security patrols, and whites wanted to avoid a costly boycott similar to those that had put many businesses into bankruptcy in other small rural towns. But leaders of the vigilante group wanted to organize a counter-boycott and starve Tha-bong into submission.

At Graham's first meeting, no blacks showed up, he said in an interview. But he persisted and finally got all sides together to strike a deal: The boycott would be called off if the White Security patrols were, too.

"People said never in the history of the gold fields has this kind of meeting taken place. It's historic," said Graham.

But racial tensions continued to flare. Before the boycotts were finally ended in May, a white had shot and injured some blacks at a taxi stand in Welkom, two whites had been stabbed and killed at the mines, and police had fired into a crowd in Thabong, killing seven blacks. But finally the deal stuck after the vigilantes' attempts to organize a counter-boycott failed to gain any support.

Graham used this initial success to persuade all sides to organize a forum of black and white officials from the two communities to meet once a month to discuss outstanding issues.

Meanwhile, at President Steyn mine on the outskirts of town, where the only common language for years has been "Fanakolo," a kind of mineworkers' Esperanto, black and white union officials are struggling to come to terms with each other's fears, demands and expectations across their own table.

Since May, the all-white Mineworkers' Union and the all-black National Union of Mineworkers have held periodic sessions with management to work out a mutually acceptable solution to such delicate racial issues as who should go up the mine elevators first at the end of the day and how to integrate changing houses.

The whites have heard the blacks express bitterness over slow job promotion, racial slurs, segregated facilities and awful living conditions in single-sex hostels. The blacks have listened to white complaints about blacks' absenteeism and refusal to obey orders, and the introduction of politics in the mines -- all of which are described by whites as signs of a breakdown in discipline.

"What we're doing is talking to each other," said David Colquhoun, from the white Council of Mineworkers, who is also participating in the talks. "Each party makes demands and often we reach a deadlock. But I believe we can make progress."

Zokwana seemed to agree. "There is movement that in the end gives hope we can find our way out through give and take," he said.

Sustaining these initial gains may not be easy; both white and black politics are in turmoil here. Odendaal, a member of South Africa's ruling National Party, was recently ousted from office by the rival Conservative Party, and the intentions of the new mayor remain unclear.

Thabong, too, has been plunged into a crisis. Last week, all but two of the 13 members of the all-black Thabong town council resigned in reponse to a nationwide call by the ANC. The ANC and its allies consider the township boards institutions of apartheid.