JOHANNESBURG, OCT. 15 -- A major apartheid law that barred blacks from public facilities for decades was formally scrapped today, but right-wing whites planned to exploit loopholes to maintain segregation.

In a separate development, police said factional fighting left eight blacks dead as rival groups battled with pistols and knives at a migrant workers' hostel in Kempton Park, east of Johannesburg. The Sunday night battle was the bloodiest incident since relative calm was restored to the black townships around Johannesburg three weeks ago.

The demise of the Separate Amenities Act, a pillar of South Africa's apartheid system, did not have noticeable effects in major cities, where libraries, parks, buses, swimming pools, toilets and other facilities have been integrated in recent years.

But in smaller towns controlled by the right-wing Conservative Party, confrontations were expected between blacks and whites opposed to the change.

In the town of Middelburg, east of Johannesburg, white residents voted to close all public facilities rather than open them to all races. Other towns planned to charge exorbitant fees for "nonresidents."

Most of the people living inside town limits are white, while blacks are forced to live outside the town boundaries under remaining apartheid laws that segregate neighborhoods. For example, the town of Bethal planned to charge an annual fee of $200 to nonresidents wishing to use the public library.

Conservative Party member of Parliament Ferdi Hartzenberg said the move to scrap the Separate Amenities Act "destroyed a considerable part of white people's own community life."

Anti-apartheid leaders urged blacks to begin using facilities and threatened strikes and boycotts against towns trying to maintain segregation. "What these councils are planning is an illegal act of banditry," said African National Congress official Joe Nkuna.

Hernus Kriel, federal minister of planning and provincial affairs, warned that towns trying to circumvent the change may face legal action.

Parliament repealed the Separate Amenities Act in June and gave communities until Oct. 15 to comply. The ruling National Party first approved the act in 1953.