South African authorities have had discussions with imprisoned African National Congress leader Nelson Mandela within the past several days about the possibility of releasing him, it was learned here today.

But after Mandela spent two hours consulting with his lawyers today in a Cape Town hospital where he is recovering from surgery, there were indications that he is not about to be released and is likely to be returned soon to the maximum security cell he has occupied for the past 23 years.

The lawyers emerged tight-lipped from their meeting with Mandela, saying that prison regulations prevented them from commenting on the discussions, but both they and government officials left little room for doubt that widespread speculation about the possible imminent release of the ANC leader was unfounded. An official in President Pieter W. Botha's office said there was "no truth" to the rumors.

Rumors of a deal under which Mandela would be flown to freedom in Zambia, where the ANC has its exiled headquarters, were also scotched when the congress was reported here as saying that this would be unacceptable to them.

But the long discussions that have been held with Mandela this week, and the confidentiality that is being preserved about them on both sides, suggested that the government in Pretoria is trying more seriously than before to find a way to release its most famous prisoner, whom opinion polls show most blacks regard as their leader.

Mandela is not only the most visible political symbol for South Africa's blacks, but his release also has been sought by western governments, including the United States, and international bankers and businessmen as a major step toward resolution of South Africa's current confrontation over its policy of racial segregation, or apartheid.

Meanwhile, as an uneasy calm returned to the troubled black township of Mamelodi today, police acknowledged that 13 persons, and not two as they reported initially, were killed when police opened fire on a crowd of more than 25,000 demonstrators yesterday.

Journalists were barred from the scene of the shooting under press restrictions proclaimed three weeks ago to limit reporting of the racial unrest, and an official police statement issued last night said that only two blacks had been killed.

But eyewitnesses, including some black reporters who live in Mamelodi, insisted that the incident was much more serious than the official statement indicated, with at least 10 persons trampled to death as the crowd stampeded to escape police gunfire. In a statement issued today, police said overnight patrols had found more bodies in various parts of Mamelodi, bringing the official death toll to 13.

In another instance of officials understating a death toll, police headquarters in Pretoria issued a correction yesterday saying that an officer had "forgotten" five bodies when he reported the number of persons killed in the eastern Cape Province town of Queenstown Monday. The report said nine persons had been shot to death, whereas 14 were killed, making it one of the worst incidents of racial violence for several months.

Rumors that Mandela was about to be released began sweeping South Africa Wednesday, fed by the fact that he is still hospitalized three weeks after an operation to remove his prostate gland, even though he has reportedly made a faster than normal recovery. There was speculation that the government would use his illness as a pretext for releasing him on grounds of compassion and that he would be flown to Zambia.

The rumors intensified yesterday, when it was learned that Mandela had asked to see his lawyers and that the prison authorities had granted special permission for consultation. The lawyers, Ismael Ayob and George Bizos, flew to Cape Town for today's meeting.

In an interview later today, Mandela's wife, Winnie, who was in Cape Town with the lawyers, threw some light on the flurry of activity, although she, too, was guarded in her statements.

Speaking after returning to Johannesburg, Winnie Mandela said her husband had told her during a visit Wednesday that he and Brig. Fred Munro, the commanding officer of Pollsmoor Prison, where Mandela is normally held, had held a two-hour discussion in the hospital.

"He told me Brigadier Munro had discussed certain matters with him, which he was not in a position to share with me, and he asked me to contact Ayob and Bizos to tell them he needed to consult with them urgently," Winnie Mandela said.

While Winnie Mandela said she did not know the content of Munro's conversation with her husband, she made it clear that she believed it had to do with his possible release.

She also said that her husband clearly had been kept in the hospital longer than his medical condition required, which she saw as an indication the authorities had been considering possible ways of using his hospitalization as a pretext for releasing him. She said he is under close police guard.

"Nelson was fully recovered after a week," Winnie Mandela said. "He could have left the hospital at least a fortnight ago."

She noted that other recent requests by Ayob to see his client have been refused.

Winnie Mandela's outline of the sequence of events seemed to indicate that Munro put a proposition concerning Mandela's release to the ANC leader, who then sent for his lawyers to discuss it.

While the official denial that Mandela's release is imminent and a statement by Bizos that he "has no idea" when the ANC leader will be freed indicated that no immediate agreement was reached, the length of the lawyers' discussions with Mandela and their noncommittal attitude afterward left an impression that the issue was not closed.

Winnie Mandela discounted the possibility of Mandela accepting a deal to fly him to Zambia. "He would reject that outright, just as he would reject any other form of conditional release," she said.

She added that the ANC also would reject such a deal. She said that she received a message yesterday from Oliver Tambo, the ANC president in exile, "telling me that they are with us in our complete rejection of this suggestion."

Winnie Mandela also denied reports that her husband had reversed his previous stand and agreed to accept release to Transkei, a nominally independent black "homeland."

"He has not yielded an inch on that, and the government will be asking for trouble if it tries to dump him there against his will," she said.