JOHANNESBURG, DEC. 13 -- Gunmen with automatic rifles opened fire on a police vehicle in Soweto shortly before midnight, killing two black policemen and wounding four others, authorities said today.

It was the most serious attack on South African police in several months and underscored warnings by the government that black nationalist guerrillas plan to escalate violence before Christmas.

The police command in Pretoria said the shooting took place in the Meadowlands section of the township as policemen taking over from a day shift were escorting home those they had relieved.

The gunmen fired from a vehicle and then escaped, leaving spent cartridges from a Soviet-designed AK-47 assault rifle, a police spokesman said. Only one of the policemen who was attacked escaped injury.

For the past three years, black policemen accused by militants of collaborating with the white minority government have been the targets of attacks in South Africa's black townships.

In Soweto, most black policemen live in guarded compounds fenced off by barbed wire and are escorted to and from work.

The police command also reported that at Kleinskool, near the Indian Ocean city of Port Elizabeth, a group of blacks threw stones at a police vehicle, injuring one policeman before being dispersed with tear gas.

At Willowglen, near Durban, a group of blacks stoned a police car, injuring one policeman, officials said.

The police said that a group of blacks at the Mpumalangu township near Pietermaritzburg attacked a house and stabbed to death a 20-year-old man.

The Pietermaritzburg area of Natal Province has been the scene of months of factional fighting between supporters of conservative Zulu Chief Mangosuthu Gatsha Buthelezi and the United Democratic Front antiapartheid coalition, which is loosely allied with the outlawed African National Congress.

Buthelezi today told members of his 1-million-strong Inkatha movement that it would be "suicidal" for black politics if they continued with vengeance killings.

Speaking at the opening of a new courthouse and clinic at Mpumalanga in Natal, Buthelezi said, "When Inkatha members take Inkatha's law into their own hands to mete out instant justice as they see it, terrible dangers face us all.

"I have seen signs of these fratricidal developments in some of your local conflicts. As your elected leader, all I can do is to hang my head in shame, for these developments will be suicidal if we allow them to increase within the black body politic," he said.

Buthelezi's statements reflected a shift of position from one in which the Zulu leader had insisted that his followers had a right to retaliate for murders committed by UDF supporters. An estimated 100 people have died in factional fighting in Natal during the past three months.

Peace negotiations between Inkatha and the UDF broke down on Wednesday when Inkatha demanded that the team representing the UDF and the Congress of South African Trade Unions repudiate a Marxist document.

The night before the talks, seven were killed in fighting between rival groups, including a man, 67, who police said was stabbed 129 times.