Police and troops fired tear gas and rubber bullets into a crowd of about 5,000 blacks today as they left a rally that was held in a Soweto cathedral to commemorate the 1976 race riots in this segregated township outside Johannesburg.

No one was injured seriously in the township, although many people, including reporters, were overcome by tear gas, and choir members tripped and stumbled on their long red robes as they fled the big Regina Mundi Catholic cathedral.

Black leaders accused the police of attacking the crowd without provocation, but one of black South Africa's most emotional anniversaries passed with less serious clashes than were widely feared in Soweto.

In violence elsewhere in the nation, a black protester died in Daveyton, a township east of Johannesburg, after he was injured fatally when police fired on a crowd throwing stones at the mayor's residence, Reuter quoted police as saying. About 100 black protesters also threw rocks at cars and buses in the coastal city of Durban.

The anniversary fell in the midst of the most persistent racial unrest since the 1976 uprising by black students protesting apartheid. And it came just three days after a South African commando raid on exiles living in the neighboring black-ruled country of Botswana.

Most of the 14 persons killed in the raid on Gaborone, the capital of Botswana, had fled Soweto during the 1976 violence and still have relatives living here. South Africa claims they were guerrillas of the underground African National Congress, but the Botswanan government and local blacks insisted that they were innocent refugees.

The 10 community and labor union leaders who addressed the crowd in Soweto referred repeatedly to the raid, and the atmosphere was more emotionally charged than in previous years. The leaders appealed to the crowd to avoid a confrontation with the police and troops, who waited outside the cathedral in heavily armed personnel carriers.

"Do not sink to the methods which the regime uses," urged Nobel laureate Bishop Desmond Tutu, who was the keynote speaker. "We must conduct ourselves in a manner that is appropriate to our cause, which is just, righteous and noble."

Nthato Motlana, chairman of the Soweto Civic Association, who is widely regarded as the ghetto's most popular leader, referred to the Gaborone raid as "an act of terrorism" and appealed to western countries to withdraw their ambassadors from South Africa "until this government gives an undertaking that it will behave according to the civilized norms of the international community."

Motlana said the envoys should remain withdrawn until South Africa agrees to release political prisoners, end forced population relocation and "withdraw all undisciplined police from our townships."

Tutu described the raid into Botswana as a "dastardly act," and blamed it on the Reagan administration's policy of "constructive engagement" with South Africa. The sympathetic U.S. attitude, Tutu said, encouraged the Pretoria government to undertake aggressive operations -- such as a commando raid into Angola's oil-rich Cabinda Province three weeks ago -- knowing that it would suffer only a mild rebuke.

A spokesman for the country's biggest federation of black labor unions, Sipho Radebe, applauded the campaign in the United States to force businesses to divest their interests in South Africa and called for its intensification.