Angolan President Agostinho Neto, who led his nation to independence in a bloody civil war and to close alligance with the Soviet Union and Cuba, died Monday in Moscow after undergoing an operation and treatment for cancer of the pancreas.

The 56-year-old peot, doctor, and Marxist intellectual was a hero of the radical left in black Africa. His death is likely to renew the power struggle that has periodically racked Angola ever since it won its independence from Portuguese colonial rule in November 1975.

It may also divert Angola's recent efforts under Neto's leadership to improve its relations with the West and establish diplomatic relations with the United States, which still has not recognized his Soviet- and Cuban-backed Marxist regime.

But his death is unlikely to bring about any radical changes in Angola's Marxist orientation or alliance with the Soviet Union and Cuba.

Neto was regarded as a shining hero among black Africa's radicals and militant nationalists because he stood up to, and prevailed over, the combined machinations of South Africa and the West, led by the United States, which backed his more moderate political opponents with arms, advisers or troops during the 1975-76 civil war and struggle for power in Angola.

In Washington and other Western capitals, however, he is more likely to be remembered as the African leader who first opened the door to Cuban, Soviet and East German involvement in black Africa, setting a pattern that has since been repeated elsewhere on the continent, most notably in Ethiopia and Mozambique.

Soviet leaders, who regard Angola as possibly their closest ally in black Africa, yesterday hailed Neto as "one of the prominent leaders of the international revolutionary movement," "a loyal friend of the Soviet Union," and "an outstanding African statesman."

Soviet President Leonid Brezhnev and Prime Minister Alexei Kosygin also sent a telegram of condolence to Neto's wife expressing grief at his "untimely death."

The State Department issued a statement saying, "We sincerely regret his passing. "Noting that he had been actively involved with the United State and four other Western powers in a search for a peaceful settlement in Namibia (Southwest Africa), it said the United States hoped the new Angolan leadership would follow the same "constructive course."

State Department officials privately expressed concern that the probable struggle within the ruling party's faction-ridden leadership over who should replace Neto could seriously impair the negotiations over Namibia.

"It's going to set them back," remarked one official. "Neto was personally involved and we've got to find someone new to negotiate with."

Neto had been scheduled to attend the nonaligned summit conference in Havana but instead flew unexpectedly to Moscow Sept. 6 for what was first officially described as a "friendly visit."

Last night, however, the Soviet news agency Tass gave an unusually detailed account of his illness. It said he had arrived "in serious condition" suffering from "chronic hepatitis which developed into cirrhosis of the liver" and an obstructed bile duct.

During a preliminary operation performed Sept. 8 with Neto's consent, the bile duct was cleared but he was found to have inoperable cancer of the pancreas, the agency said, citing a report signed by two top specialists of the Soviet academy of medical sciences.

Complications followed and he died, the report said.

Neto was known to have been suffering from leukemia, a cancer of the blood, for the past several years.

There was no immediate word from the Angolan capital of Luanda as to which leader of Angola's ruling Marxist Popular Movement for the Liberation of Angola would take over the country's leadership.

The party's political bureau decreed a 45-day period of national mourning while a high-level delegation left for Moscow to escort his body back to Luanda.

News agency reports said Neto had appointed his planning minister, Jose Eduardo dos Santos, to run the government in his absence and speculated he might take over as the new president.

But a more likely candidate seemed to be Lucio Lara, the party's secretary for organization and ideological education, a close personal friend of Neto for years and the man he appointed to head the MPLA in his place.

Customarily Lara was put in charge of the country in Neto's absence but was reported on vacation in Portugal at the time of Neto's death.

He is thought to be more anti-American than Neto, who for the past year has been trying to engineer an opening to the United States and has been talking about the need for MPLA to maintain its "independence" from outside powers an obvious reference to the Soviet Union.

Despite Moscow's description of Neto as "a loyal friend," there were strong indications that Soviet leaders were not altogether happy with his efforts to improve relations with the United States and cooperate with the five Western powers involved in negotiations with South Africa over Nambia.

In addition, Neto last year was reported upset by rumors in Luanda that the Soviets were backing his former prime minister, Lopo de Nascimento, to take over the government in case of his death. Neto fired Nascimento in December and sent him far away to Addis Ababa to work for the U.N. Economic Commission for Africa.

Whether Nascimento will now make a comeback remains to be seen and could depend partly on which of the many possible contenders for the presidency the Soviet Union and Cuba now decide to support.

Among these contenders in addition to Lara, dos Santos and Nascimento is Iko Carreira, the Angolan defense minister, who has a strong following of his own within the army and party.

Despite the probable power struggle to replace Neto, Angola's close alliance with the Soviet Union -- cemented in a treaty of friendship and cooperation signed by the late president himself on his first trip to Moscow in October 1976 -- is not likely to be adversely affected.

Not only are most MPLA top officials strongly Marxist-oriented and in favor of the alliance, Soviet arms and some 20,000 Cuban troops remain essential to contain the activities of South African-backed, antigovernment guerrillas still active in southern Angola.

Ironically, Neto, who was widely cast in the Western press as little more than an "agent" of the Soviets and Cubans, was probably the most "moderate" of MPLA leaders toward the end of his life and personally responsible for Angola's opening to Western Europe and the United States beginning early last year.