Mobs of black youths today opened fire on police and rampaged through this black township in the heart of Johannesburg's all-white suburbs in one of the bloodiest episodes of racial violence to hit this country in several months.

There was also a shootout in a township near Port Elizabeth in which two black men suspected of being members of the outlawed African National Congress were killed and two policemen wounded, according to the police.

In Alexandra, a black police sergeant was shot dead and his corpse burned and mutilated, and another was wounded by gunfire, police reported. They said three black males, two of them under 18, were shot dead by police.

But witnesses said they saw four other policemen and soldiers shot, three of them whites. They also said a mob gasoline-bombed an armored police vehicle early this morning and stole two automatic rifles. A police spokesman denied these accounts.

There were also conflicting tallies of dead and wounded, with police reporting nine dead and 14 wounded since Saturday while witnesses and doctors put the figure at at least 12 dead and 40 wounded. Ambulances and fire trucks were pelted by rioters and unable to remove some of the bodies.

Neither the police report nor witnesses' accounts could be independently verified because police invoked emergency regulations and banned journalists from the area, although it was possible to watch from a nearby hill and to interview residents as they left the area.

They described bands of youths moving through the dirt streets and alleyways, laying siege to houses and shops and attacking police vehicles patrolling the area. Their main targets were black police and township officials -- all judged to be "collaborators" with the apartheid system because they are employed by the white-minority government.

One witness said the youths had set up a gasoline-bomb manufacturing station next to her house and were turning out hundreds of molotov cocktails. Another woman, who lives next door to a policeman, said the mob had used her house as a staging post for three attacks on her neighbor's home and were preparing a fourth when she fled this morning.

Witnesses also described how one man rescued his neighbor, a black police sergeant, from a mob that had dragged the officer from his house this morning. The policeman had been prepared for "necklacing" by being doused with gasoline and having a rubber tire placed around his neck. But the neighbor, a Methodist Church elder, pleaded for his life, lifting his arms and crying, "People, don't kill him. He is a black man like us."

The mob let the sergeant go but first stripped off his uniform, shoes and belt and ransacked his house for his police identification card and other documents and furniture, burning them in a bonfire outside. They also took his handgun.

A member of the local town council was shot in the stomach by rioters, according to police, and the houses of several other council members were firebombed. At least four local buses were also burned.

The township borders a small factory and warehouse area that separates it from surrounding white suburbs. Dozens of whites wielding pistols and shotguns patrolled that section today. Witnesses said at least four factories were stoned during the night and two blacks shot dead.

The witnesses asked not to be identified, saying they feared retribution either from the rioting youths or the police.

As night fell, the township remained under siege, with police in armored vehicles scattering small groups of chanting youths and smashing the makeshift barricades of tires and furniture that had blocked some of the streets since Saturday. Sporadic rifle fire and the thud of tear-gas launchers could be heard, and columns of smoke rose from houses and cars. The wounded were still arriving at clinics on the outskirts of town.

More than 40 wounded had streamed into the Alexandra Clinic on the township's border until this morning when two police officers entered the clinic to demand a list of the names of the wounded, according to doctors there. The demand was rejected, said a clinic spokesman, who cited medical ethics in refusing to reveal information about specific patients.

A clinic official was subpoenaed by police, but they failed to show up at a court hearing this afternoon. After the incident, police put up a roadblock on the street leading from the township to the clinic and the flow of wounded ceased abruptly for several hours, the spokesman said.

The violence started Saturday following funerals for two young activists. Witnesses said police touched off stone-throwing when they broke up the traditional washing of hands at the victims' homes by firing tear gas. Police said they began firing only after the crowd moved to attack policemen's houses.

The Port Elizabeth shootout began after a man was arrested in one township for possession of a hand grenade and a revolver. Police then went to a second township to search a house when they were fired on by a man with an AK47 automatic rifle. One man was killed and another arrested, and a policeman was shot in the leg. A man who threw a grenade at police during another house search was shot dead and one policeman was wounded.