Tens of thousands of singing, chanting South Africans swarmed over a hillside cemetery in this black township surrounded by Johannesburg's all-white suburbs today as 17 persons killed in clashes with the police were buried.

The funeral rally, including several hundred whites, was the biggest in 18 months of racial conflict. A large contingent of troops and police in armored personnel carriers stood by, but they kept clear of the huge crowd and there were no incidents.

One young black was shot dead and two others were wounded in a clash with police last night, however, as people began gathering in Alexandra for the funeral.

The whites in the crowd today included diplomats from the United States and six other western countries, making up the largest white attendance at such funerals, which characteristically turn into African nationalist political rallies against the apartheid system of segregation.

It was the second time members of the diplomatic corps have attended a funeral of those killed in conflicts.

Also for the second time, a big red Soviet Communist Party banner, with its hammer and sickle, was unfurled during the procession to the cemetery by flag bearers who masked their faces. The Communist Party is outlawed in South Africa.

This was symptomatic of a growing tendency by black militants to look to the Soviet Bloc for support as they perceive the U.S. and other governments in the West to be "soft" on the white-minority rule of President Pieter W. Botha.

The unusually high white attendance at the funeral reflected the impact that last month's outbreak of racial violence here had on whites because of the township's proximity to their houses.

A feature of the protracted unrest in the black townships has been its limited impact on whites because of their remoteness from it. The violence has mostly been confined to segregated townships far from the white areas, so that whites only read about it in their restricted newspapers and saw little live coverage on the semiofficial television service.

But Alexandra, an old slum township that Johannesburg's urban sprawl has ingested, is different. As the violence raged there for three days in mid-February, white suburbanites for the first time could hear the sound of gunfire from their neighborhoods. At least 23 blacks and one policeman were killed.

Responding to this heightened concern, members of the all-white Sandton Town Council that governs this part of greater Johannesburg, led by town manager Ricky Valente and accompanied by the member of Parliament for the area, David Dalling, attended the funeral. Valente said his council contributed $250 to the funeral costs of each of the bereaved families "as a gesture of sympathy."

In everything but name, the funeral was a mass rally of the underground African National Congress. Three of its black, green and yellow banners were paraded around the sports stadium where the main ceremony was held, then carried through the township's streets to the cemetery.

The 17 coffins were draped in the ANC colors. Songs and slogans praised the organization's exiled and imprisoned leaders. The crowd broke into wild cheering as Winnie Mandela, wife of the imprisoned ANC leader Nelson Mandela, entered the stadium beneath a huge green, black and yellow floral cross.

Speaker after speaker called on the Botha government to lift the ban on the organization and negotiate with its leaders, warning that the impending end of the state of emergency -- promised by Botha yesterday -- would not halt the resistance unless a political settlement was reached.

Addressing the foreign diplomats, Frank Chicane, a leader of the activist United Democratic Front, told them: "Please stop thinking of the Botha government as a government that is keeping law and order. It is a government that has declared war on the people of this country who have no vote.

"What you must understand is that the people are simply refusing to collaborate with a regime that was imposed on them. We won't be peacefully oppressed. There is no way the Botha regime can continue to run this country except at the cost of more and more lives of the people," Chicane added.

Police reported another 21 violent incidents since yesterday, in which four persons were killed.

An explosion rocked an armaments factory in the Cape Province town of Somerset West today, killing one white worker and injuring three, one of them seriously. A spokesman for the company said the explosion was caused by an "industrial accident."