At least 12 more blacks have died, apparently at the hands of other blacks, the government reported today. It was the highest one-day death toll since South Africa imposed a state of emergency five weeks ago.

There also were unconfirmed reports of other deaths in Soweto, where police used tear gas to break up a march by several thousand blacks. They were protesting the threatened arrest and eviction of residents who refuse to pay rent as a protest against the white-ruled government and against blacks who collaborate with it by serving on the Soweto town council.

Meanwhile, a three-judge court in Durban upheld the legality of the emergency, but restored a measure of free speech here by throwing out part of the government's sweeping definition of "subversive statements" banned under the decree. The panel also ruled that detainees have the right to lawyers. Such access has been effectively barred since the emergency began.

This article was written under terms of the government's restrictions on press coverage during the state of emergency. The restrictions forbid reporters to refer without authorization to actions carried out by the security forces, or to report statements the government considers subversive.

Of the 12 confirmed deaths, 11 occurred yesterday in the troubled black "homeland" of KwaNdebele north of Pretoria, the state Bureau for Information reported.

It said police found the bodies of nine unidentified men in a partially burned house in the remote Vlaklaagte area. The men were believed to have been shot with an AK47 rifle and their bodies set afire along with the house. There was no immediate explanation for the deaths.

Two other burned corpses were found in separate incidents in KwaNdebele. The 12th victim was a 30-year-old man knifed to death by a gang of about 10 men after they firebombed his house in a black township outside Durban. It was impossible to confirm the government's account independently because of the emergency restrictions.

KwaNdebele is slated by the white-led government for what is termed independence later this year and has been the scene of widespread violence between supporters and opponents of the move.

Violence broke out in Soweto, the country's largest black urban area, after police staged pre-dawn raids on the houses of some of the thousands who have refused to pay rent since early June, residents said. They said some dwellers were arrested despite an annoucement yesterday by the town council that it would delay evictions or other action until next week.

By early afternoon, several thousand residents had gathered in the Naledi area and marched to the town council offices in violation of a police ban on outdoor demonstrations. Witnesses said the protest was peaceful but police intervened, firing tear gas to disperse the crowd.

United Press International, citing unidentified witnesses, reported that five persons had been killed. But there was no confirmation by the government or by witnesses to the demonstration.

The rent boycott has cut town council revenues by 60 percent. The government contends its effectiveness is the result of widespread intimidation of residents by young militants, but local leaders contend it is the only way the community can register its anger over the emergency and the resulting arrest of at least 4,000 antiapartheid activists.

In rejecting most of the contentions of a lawsuit brought by the predominantly black Metal and Allied Workers' Union, six of whose leaders are in detention, the Natal Provincial Supreme Court upheld the state's sweeping power to detain people without charge, seal off areas and control the news under the emergency. But it threw out two of the six clauses dealing with "subversive statements," and rejected parts of three others.

Justice John Didcott said two clauses barring statements that advance the objectives of unlawful organizations and "engender hostility" between persons or groups were so vague that they were "unintelligible."

He also objected to portions of three other clauses prohibiting statements that encourage sanctions against South Africa, incite persons to oppose emergency regulations, or weaken confidence "in the termination of the state of emergency." Portions of these clauses were also unenforceably vague, Didcott ruled.

The only clause he upheld fully was one that forbids incitement of persons to participate in illegal strikes, boycotts or marches or to oppose military conscription.

The court's judgment can be appealed by either the union or the government to a state appeals court. There was no indication tonight whether either side would do so.

Also today, the government dropped charges against Cape Times newspaper editor Anthony Heard that he had illegally quoted a "banned" person when he published an interview last November with Oliver Tambo, head of the outlawed African National Congress. Charges were filed instead against the company that owns the Cape Times.