PORT ELIZABETH, SOUTH AFRICA, NOV. 5 -- Govan Mbeki, a former president of the outlawed African National Congress and a prominent figure in the black struggle to overturn white rule in South Africa, was released from prison today after serving 23 years of a life sentence for treason.

Mbeki's dramatic release, with four other black militants, immediately touched off speculation that Pretoria was testing the reaction among white South Africans to the eventual freeing of imprisoned ANC leaders Nelson Mandela and Walter Sisulu, who also are serving life sentences imposed in the same 1964 trial at which Mbeki was convicted.

The government of President Pieter W. Botha also was believed to be concerned that Mbeki, 77, Mandela, 69, and Sisulu, 75, might die in prison, becoming martyrs to the black cause and sparking further violence.

Although the government offered no explanation for its decision, reform-minded senior officials have said in recent months that they believed it was important that Pretoria try to break through black militants' mistrust of South African motives and establish an interracial dialogue.

Stoffel van der Merwe, deputy minister for constitutional planning and a leading proponent of negotiations on black-white power sharing, said in an interview in September that he regarded the ANC as a major player in any such talks.

In Washington, State Department spokesman Charles Redman said the United States welcomed Mbeki's release and urged South African blacks and whites to use the opportunity "to create a climate for dialogue."

{At ANC headquarters in Lusaka, Zambia, where jubilant black militants clapped and danced at the news of Mbeki's release, a senior ANC official, Mac Maharaj, said the move was designed to stave off international political and economic pressures to abolish apartheid, South Africa's system of racial segregation, Reuter reported.}

Mbeki's release comes at a time when illegal black protest activity has been largely suppressed under the country's strict state of emergency. It follows the Botha government's recent acceptance of limited changes in housing under apartheid and a proposal to relax segregation of public school sports events.

Also released today were two members of the Afrikaner Resistance Movement, a white supremacist organization, who were jailed in 1983 for sabotage.

Mbeki said in an interview here that he had accepted no conditions on his release and that he intended to "continue the struggle for freedom for all South Africans."

However, an official of the state Bureau for Information, which sought to control press coverage of Mbeki's release today, said that under South Africa's security laws Mbeki may not be quoted in domestic media in the future because of his stated commitment to the Communist Party of South Africa, which is banned.

The official, Casper Fenter, said Mbeki's remarks to reporters here were "a one-time thing only, a special dispensation from the minister of justice," H.J. Coetsee.

Mbeki was flown by helicopter from Robben Island Prison off Cape Town's eastern shore to the nearby Pollsmoor Prison, where he met for more than an hour with Mandela. Mandela is regarded by many of South Africa's 23 million blacks as the country's potential leader when and if white minority rule collapses.

From Pollsmoor, Mbeki was flown to this eastern Cape Province port city, where he met with scores of waiting reporters at the Holiday Inn.

Mbeki insisted that this is where he should be released, despite government attempts to place him in the ostensibly independent tribal "homeland" of Transkei.

"I have not renounced violence. I'm still a member of the ANC," Mbeki declared as government officials looked on from the side of a banquet room. "The ideals for which I went to jail, and for which the ANC still stands, I still embrace."

Later, in an interview in his hotel room, Mbeki said he believes that Mandela's release is inevitable. "There will be no logic in releasing me and not him. It has to happen. We hope that he comes out soon," Mbeki said.

In contrast to South African press reports that he was close to blindness and in failing health, Mbeki appeared fit and relaxed as he talked about returning Friday to his home in the nearby black township of New Brighton.

"Yes, I have a role to play in the struggle to freedom. All along, I was feeling a bit down, but tonight I am feeling good. But I am also concerned about my comrades, especially those I am leaving behind. But I am confident that in due course they will be let out under the same conditions."

Mbeki refused to renounce violence as an ANC strategy, saying the ANC military wing Umkhonto we Sizwe (Spear of the Nation) "is an organization of the ANC that is necessary as long as the ANC sees it that way."

Mbeki said he plans to apply for travel documents so he can visit his son, Thabo, the ANC's chief information official in Lusaka.

Mbeki has long been regarded as a bellwether for the release of other celebrated black political prisoners in South Africa.

On Aug. 13, Botha gave momentum to speculation about Mandela's release when he said he had asked Coetsee to look into freeing Mbeki on humanitarian grounds.