JOHANNESBURG, JULY 29 -- The South African Communist Party officially surfaced today from 40 years of underground activity, holding its largest public rally ever and pledging to work hand-in-hand with the African National Congress for a peaceful political settlement between the white-minority government and the nation's black majority.

Addressing a crowd of 35,000 in the black township of Soweto, Communist Party Secretary General Joe Slovo denied government allegations that his party has been plotting an armed insurrection and that it has no intention of abiding by the ANC's and the government's commitment to negotiate peacefully an end of apartheid.

"We have said over and over again in our party that we as a party are committed both to the letter and spirit of the process which has begun, that we are committed both to the letter and spirit" of a May 4 agreement between the ANC and the government, he said.

ANC leader Nelson Mandela, who also spoke at the rally to show his solidarity with Communists, told the crowd that the Communist Party and his own organization "share the same views about the vital importance and urgency of arriving at a political settlement through negotiations."

"To suggest, as some are doing these days, that these outstanding sons and daughters of our people harbor ideas of unilateral military action against the peace process is an insult manufactured by the enemies of democracy," he said.

Mandela and Slovo were the main speakers at the rally attended mostly by union members, some wearing hard hats. The crowd stood at attention when the Communist "Internationale" was sung by a chorus but few seemed to know the words to a song not heard in public here since the party was banned 40 years ago.

The ban was lifted Feb. 2 in a series of measures by President Frederik W. de Klerk. The South African party, one of the oldest in Africa, was founded in 1921 and celebrated its 69th year today.

De Klerk last week asked Mandela to exclude Slovo from the next round of government-ANC talks Aug. 6 because of the allegations that the Communist leader is not committed to a peaceful negotiating process.

Mandela did not say what his response would be. He is scheduled to deliver it to the president Wednesday. But his comments today indicated he is likely to reject de Klerk's request just as he did a similar one before the first round of talks in early May.

He called Slovo "an old friend" and referred to Communist members of the ANC as "close friends and colleagues." At the same time, the black nationalist leader rejected Marxism as the ANC's guiding ideology. "The ANC," he said, "is not a communist party. As a movement for national liberation, the ANC has no mandate to espouse a Marxist ideology."

But, he added, the ANC would defend the right of any South African to adhere to Marxist ideology "if that is their wish" and would fight for the Communist Party's right to exist.

Slovo also commented on de Klerk's request that he be excluded from the Aug. 6 talks, saying, "They accuse me of not being committed to the peace process but it is they who try to keep me out of the peace process."

Slovo said he agreed with de Klerk "that a negotiated solution is in the interests of all South Africans -- white and black," and strongly denied government claims that he had said his party would not be bound by an ANC-government cease-fire agreement. He also disputed police allegations that the Communist Party was planning an armed insurrection if negotiations break down. He said the so-called Operation Vula the police had referred to had been underway since 1987 and was ordered by the ANC leadership to build an underground armed force within the country.

If Slovo's denials are true, they raise questions of whether South African security officials have deliberately distorted captured documents to discredit Slovo and the Communists and cause a split between them and the ANC. Slovo referred to a speech in Brussels by the ruling National Party's chief spokesman, Renier Schoeman, who said that one of the government's primary objectives was to cause a parting of the ways between the ANC and the Communists.

The Communist Party officially confirmed today the names of many Central Committee and Politburo leaders. Among them were Chris Hani, chief of staff of the ANC's military wing, Spear of the Nation, and Moses Mayekiso, general secretary of the National Union of Metalworkers.