Police opened fire on a crowd of more than 25,000 demonstrators, most of them women, in Pretoria's black township of Mamelodi today, killing several and causing a stampede in which hundreds were injured, witnesses said.

The witnesses described scenes of panic and chaos in which some people were trampled to death as the crowd tried to flee the police gunfire.

An official statement said two blacks were killed when police dispersed groups that had gathered illegally. Under new government restrictions on the media introduced three weeks ago, newspaper and television reporters were prohibited from going to the scene of the shooting. The only way journalists were able to report the incident was by telephoning witnesses in the segregated township, which has few telephones.

Meanwhile, rumors swept South Africa today that the government is considering releasing imprisoned black leader Nelson Mandela, who is in a Cape Town hospital recovering from surgery.

His wife, Winnie Mandela, fueled the speculation when she refused to say at a news conference in Cape Town whether she or her husband had met with government officials in recent weeks. She said she took seriously the speculation about her husband's release, but denied local press reports that he had reversed his previous stand and agreed to accept release to Transkei, a small territory set aside as a nominally independent black "homeland" under South Africa's system of segregation, or apartheid.

The fact that Mandela is still in the hospital 19 days after his operation, from which he is said to have made a rapid recovery, has added to the speculation. So did an official announcement tonight that a request by him for permission to meet with his lawyers Friday had been granted.

But a statement by President Pieter W. Botha at a Pretoria news conference today that "no decision has been taken" on Mandela was regarded by some as a denial that the government is about to release the African National Congress leader, who has served 23 years of a life sentence for plotting the violent overthrow of white minority rule. The president's office later issued a statement saying "there is no truth in the rumors."

The exclusion of reporters from Mamelodi led to confusion about the number of casualties. While the official police statement said two blacks had been killed, witnesses said many more had died.

The capital's biggest newspaper, the Pretoria News, basing its report on black staffers who live in the township, said six had died. One of these staffers, reporter Seja Motau, said he had seen at least eight inert figures on the ground after the shooting and the stampede, but he did not know how many of these were dead.

Lucas Banda, another black reporter who lives in Mamelodi, said on the telephone tonight that he had received reports of 10 persons killed but so far had been able to confirm only three deaths with the victims' families.

David Itsweng, a doctor, said two women had died in his office, one from the effects of tear gas. He said he had treated at least 20 others for shotgun wounds.

Another doctor, who did not want to be named, said he had given emergency treatment to a young girl and a man, both with serious bullet wounds, then rushed them to a hospital. He said he did not know whether they had died.

Many of the witnesses who were telephoned asked that their names not be disclosed, saying they feared reprisals either by the police or young black radicals who had organized the demonstration.

"We are in a pincer movement here between the police and the youth," said one, adding that there had been "a certain amount of intimidation" by radicals who forced residents to join the protest march.

They gave an account of terror and mayhem as people tried to flee the blasts of tear gas, buckshot and bullets that police pumped into the big crowd when it failed to heed an order to disperse. After the shooting, they said, young blacks had set up barricades of rocks and burning tires in the township's streets. Resentment against the black council that administers Mamelodi for the white minority government has been building for some time, according to John Mojapelo, a former journalist who lives there and whose wife was at the back of the crowd when the police began shooting.

This resentment reached a peak Tuesday when residents stayed away from work and held a community meeting to discuss their grievances. They decided to stage a demonstration today to protest police brutality, a new restriction prohibiting funerals on weekends and limiting the number of mourners at weekday funerals, and a sudden increase in house rentals and electricity rates.

Describing what happened during the march, Banda said the crowd, which he estimated at "somewhere between 25,000 and 50,000," arrived at the township council's offices, which are surrounded by a high security fence with locked gates, and demanded to speak to the mayor, Bernard Ndlazi.

Ndlazi appeared with a heavy police escort and climbed onto an armored personnel carrier that was parked in the council office grounds behind the fence. He tried to address the crowd using a bullhorn, but young radicals drowned him out, Banda said.

The mayor abandoned his speech, and a police officer ordered the crowd to disperse, Banda said. With that, some people in the crowd began throwing stones, and an order to the police to open fire was given.

Banda and other witnesses said the crowd panicked as the shots rang out. Elderly people and children were trampled as the stampede began. So great was the pressure of the stampede that at one point the security fence was ripped open, they said.

The rumors about Mandela's pending release swept South Africa as the African National Congress published a position paper in London setting out the conditions under which it would be prepared to consider negotiations with the government. Chief among these was the release of the organization's imprisoned leader.

One of the rumors circulating in Cape Town tonight was that the government was considering offering to release Mandela into Zambia, where the congress has its exile headquarters, but wanted first to get a sense of how he might respond to such an offer.