JOHANNESBURG, DEC. 10 -- About 60 black policemen mutinied against their white commander today and then fought a gun battle with riot police called to put down their uprising.

Seven constables from the Leoka municipal police force in Sebokeng, about 35 miles south of Johannesburg, were wounded in the fighting, according to police headquarters in Pretoria, and 19 were arrested on charges of mutiny and attempted murder.

The mutiny apparently stemmed from long-standing grievances that the local policemen had about their commander and working conditions, but police spokesmen said in Pretoria that they were uncertain what led to the full-scale riot.

The local commander had just ordered a vehicle inspection when the policemen rebelled, got into their cars and trucks and attempted to run him down, according to a police statement.

When heavily armed riot police arrived, the constables broke out of the local police compound, opening fire with their pistols and shotguns, the statement said. The riot police fired back, using buckshot and tear-gas grenades, and eventually dispersed the local policemen. Order was restored later in the day, a police spokesmen said.

Many of the constables evaded arrest by shedding their uniforms and fleeing into Sebokeng, long one of the most volatile black townships in the country.

Residents said that the constables, regarded by many in the community as collaborators and "sell-outs" for working for the government, banged on doors asking for shelter from the pursuing riot police.

The incident was the latest in a series that have called into question the loyalty of black policemen and soldiers to the country's white-led minority government.

With forces stretched thin by more than three years of civil unrest, by the stepped-up guerrilla attacks of the outlawed African National Congress and by the prolonged war in neighboring Namibia, Pretoria is now relying increasingly on blacks, both in the police and the Army.

The expanded recruitment of blacks not only helps resolve an acute manpower shortage -- whites now constitute less than 15 percent of South Africa's population -- but it is supposed to tighten the bonds of moderate and conservative blacks to the government.

Yet, recent incidents are undermining this policy, which is a central element in the government's overall strategy of curbing unrest while proceeding with gradual reform.

More than 400 members of the South-West Africa Territorial Force in Namibia reportedly refused to fight in Angola last month in support of the rightist guerrillas of the National Union for the Total Liberation of Angola (UNITA).

Municipal police have gone on strike, generally for higher pay and better working conditions, in six other black townships around Johannesburg in the past year.

Two black security policemen, convicted of spying for the African National Congress, also were sentenced last week to 14 years in prison each. Senior police sources said that the pair, based in Pretoria, had provided the ANC with considerable sensitive material while letting ANC guerrillas and political cadres operate freely. ivists who had returned after military training, were hiding with a cache of arms. After returning the fire, they crushed the shack with an armored truck.

In Cape Town on Thursday, a political commissar in the ANC's military wing, Spear of the Nation, was sentenced to 17 years in prison for terrorism and attempted murder for attacks on two policemen and planting an unarmed bomb in a shopping center.

Mxolisi Petane, 29, had sought prisoner-of-war status under international conventions and will appeal his conviction and sentence.

AP-NY-12-10-87 1623EST