Although the Soviet Union hailed Angolan president Agostinho Neto as a Marxist hero when he died, a pro-Soviet faction of his party tried to assassinate him three times before he came to power and the Soviets never trusted him, according to a senior African diplomat here.

The Soviets, it was said, lined up behind Neto at a time when Portugal was divesting itself of its African colonies because he was the only Marxist nationalist leader respected by new Portuguese authorities to be included in negotiations on transferring power to an independent Angola.

The source, who has had a front-row view of the long and complicated Angolan developments, is a distringuished African whose reliability and knowledge has been verified by other Angola experts.

Despite continued overt cordiality, Soviet-Angolan relations were beset with numerous problems, and Neto traveled to Moscow in early September to seek their resolution as well as medical treatment.

The diplomat recalled that in 1977, the Angolan president had appealed secretly to Portuguese President Antonio Ramalho Eanes to send Portuguese troops to Angola to replace the 20,000 Cubans there.

Eanes, the source said, was forced to conculde reluctantly that Neto's head was too tightly held in the Cuban grip and that any Portuguese move would most probably constitute a death sentence for the Angolan leader and would only leave the Cubans more firmly rooted.

All three of the most likely successors to Neto are considered to be far more solidly in the Soviet or Cuban camps than the leader, who died Monday in Moscow after an operation.

His death at 56 reopens a number of questions that apparently had been settled. Neto is understood to have refused to grant Soviet requests for bases in Angola. With Cuban backing, he had been pursuing a policy of rapprochement with the West and with his old African foes like Zaire's Mobutu Sese Seko.

Neto's diplomatic opening to the West coincided with a period when Cuba apparently had hoped it could reduce the size of the Cuban contingent in Angola both because of its cost to Havana and because it stood in the way of improving Cuba's relations with Washington.

So, when a pro-Soviet faction of Neto's ruling Popular Movement for the Liberation of Angola attempted a coup d'etat in May 1977, the Cubans put down the plot and pursued its leader, Neto Alves, into the bush.

Neto, according to the diplomatic source, was able to come to power in Angola in the first place only because of the democratic revolution in Portugal. Before that, the source said, there were at least three assassination attempts against him in three years by elements in his own party linked to the Soviets. Neto fled to the Congo (Brazzaville) for safety and stayed there for a year before Angolan independence in 1975.

There were armed skirmishes between Neto supporters and the hardliners in his party's training camps at the time. When the Socialists suddenly became the dominant force in Portugal, the source said, the Soviets lined up behind Neto because they needed his prestige as the historic leader of the party.

It seemed obvious, the source noted, that figures like Portuguese Socialist leader Mario Soares would only accept the Popular Movement, Iko Carreira, and would inevitably have managed to unseat Neto who was not in effective control of his organization, the source said.

"By using Neto's name," the diplomat said, "the Soviets managed to split the Organization of African Unity right down the middle. We knew that in a showdown, there would be 22 votes to recognize Neto as the leader of Angola and 21 against him. Eventually the Russians would have moved against him again, though. Maybe they held off in the end because they had been treating him for some time and they knew how bad his health was. Even if he had lived, Neto couldn't have gotten rid of the Cubans for years. He acted like a man with a noose around his neck."

Neto was also pressed hard by UNITA, the main rival movement to the Popular Movement. Led by the charismatic Jonas Savimbi, UNITA still controls most of southern Angola. Many outsiders dreamed of reconciling the two leaders, but the diplomatic source, who knew both men well, said that Neto feared Savimbi's ability to rally public opinion.

"No matter what position Neto could have given Savimbi in a joint government, Savimbi would have dominated by the force of his personality," said the source.

Neto, who was a major Portuguese-language intellectual figure, was not a crowd-pleaser. Although he started out as a communist, he had evolved personally into a relatively moderate social democrat, said the diplomatic source.

He had also preserved his ties with his Methodist heritage. His father was a Methodist minister. Neto was a product of American Methodist mission schools, and he was put through university by Ralph Dodge, the American Methodist bishiop of Luanda.

Neto used Bishop Dodge to send his first direct signal to the Americans that he wanted to improve relations. According to the bishop, Neto asked him during a return visit to Luanda to tell the State Department that he was ready but that the Americans should not insist on the departure of the Cubans as a precondition because they were essential for his security.

There were nevertheless Western efforts to try to get rid of the Cubans. France toyed early this year with a proposal to replace the Cubans with a four-nation East-West force composed of Portuguese, French and two East European members of the Soviet bloc.

This, the French reasoned, would have made it possible for Neto and Savimbi to get together.

Although the French do not currently appear to be supplying Savimbi militarily, as they used to, they have remained in touch with him. He has twice secretly visited France, diplomatic sources say.