Police wielding plastic whips smashed a peaceful protest by nonwhite high school students in downtown Cape Town today as political unrest moved into the white area of the city for the first time. Later in the day 40 persons were reported wounded in running street battles between students and police in nearby mixed-race townships.

Witnesses said dozens of mixed- race, or Colored, students were set upon by police after they started singing "We Are the World" outside an entrance to Golden Acre, Cape Town's newest and most elaborate shopping mall. The witnesses said police gave no warning before attacking the group with whips.

The police action against the Cape Town students appeared to be in line with a recent policy of cracking down quickly and firmly against any gatherings deemed illegal, whether violent or not. The idea, as expressed by police officials, is to prevent such demonstrations from turning violent.

Similar tactics were used last week in crushing demonstrations in townships near the city. But they helped set off a new round of violence that took more than 30 lives. They also led to widespread charges of police brutality.

Meanwhile, several thousand striking black mineworkers returned to their jobs following last night's announcement that the black National Union of Mineworkers was suspending its two-day walkout. But one mining company announced that it was firing more than 900 workers at one of its gold mines because they had participated in the strike.

More than 200 students, members of a Colored high school students' organization, gathered today with protest placards inside and outside the Cape Town mall. They had begun singing softly when police arrived.

One witness cited by the South African Press Association, Brian Lombard, said about a dozen policemen approached the students from a nearby street and "laid into them" with whips.

An unidentified witness said police chased the students down Adderley Street, the city's main thoroughfare, striking "indiscriminately" at young people.

"There was no way the police could know who they were hitting," she said. "Any kid who ran got slammed with a sjambok," or whip.

Police issued a statement tonight saying they had "dispersed a group who had gathered illegally and, in the process, arrested five persons."

The press association reported that more than 40 persons were wounded in other confrontations between police and youths in several townships near Cape Town.

Some of the most serious violence was in Athlone, a Colored township. Students who gathered for a mass rally at Belgravia High School there erected at least 30 burning barricades and heaved rocks and gasoline bombs at police who broke up the meeting.

Witnesses said the trouble started when a group of about 200 youths broke off from the rally of 4,000, set up a barricade and stoned a police lookout observing the gathering. Police then descended upon the school grounds, firing rubber bullets and tear gas.

The Cape Times newspaper reported that at the height of the action, police in a dozen vehicles were racing up and down township streets firing shotguns and tear-gas canisters into backyards. It quoted an unnamed police captain as saying, "We are using live ammunition because they are not taking any notice of the rubber bullets." Residents in the area said at least five persons were wounded.

In the eastern Cape Province city of Grahamstown, police used whips to break up a mostly white crowd of student demonstrators at the entrance of Rhodes University. Twenty-two persons, including two university doctors, were arrested.

Police later confirmed that they had found the body of a black policeman under a pile of burning tires in a black township outside Grahamstown last night.

A prominent right-wing politician, meanwhile, said South Africa's white-ruled government had not been tough enough in dealing with the political unrest that has claimed about 675 lives in the past year.

Conservative Party leader Andries Treurnicht accused officials of "keeping our security forces on a leash," saying they had failed in honoring the government's "most basic duty, the preservation of law and order."

Labor peace was reported restored at the four gold and coal mines that until last night had been struck by the mineworkers' union.

More than 7,000 former strikers reported to work, but the union went to court seeking an order to prevent evictions of fired workers from the Marievale mine owned by Gencor. The company said it would fire more than 900 former strikers.