When Rhodesian guerrilla leader Robert Mugabe said goodbye to his Nigerian hosts and climbed aboard a waiting aircraft in Lagos almost four months ago, U.S. and British diplomats were convinced that they were within days of achieving their long-sought goal -- a peace conference to end the war in Rhodesia.

"We had the feeling that Cyrus Vance and David Owen were glued to their telephones waiting for the report of success from Nigeria," Mugabe's chief political aide, Edgar Tekere, recalled later in speaking of the U.S. secretary of state and the British foreign minister.

To the handful of world leaders and diplomats who knew about it, the secret Aug. 19 meeting in Lagos did look like the penultimate stroke in an inspired diplomatic strategy that would not only halt the white vs. black fighting devastating Rhodesia, but also would head off a wider black vs. black civil war in the future.

Today, those prospects have disintegrated.

The guerrilla war is escalating. Rhodesia's Salisbury government is backing away from earlier pledges of majority rule. The Anglo-American diplomatic initiative appears to have run into a dead end.

Even this summary may understate the turnabout that has occurred in the past months in southern Africa. There is now a good chance that instead of heading off a future tribal war for control of Rhodesia, the diplomatic strategy that brought the Nigerians so deeply into the Rhodesian crisis has deepened longstanding divisions within the ranks of the guerrillas and their African supporters, and has brought all-out civil war a step closer.

The Carter administration's heavy and proud investment in wooing key African states that had been hostile to the United States in the past is also being diminished by the fall-out of the Rhodesian exercise. Nigeria's leaders feel they have been burned by their highly visible role, and last week they effectively withdrew from participating in the Anglo-American effort on Rhodesia.

Notes of distrust have again crept into the dialogue between Washington and African supporters of the Patriotic Front guerrillas headed jointly by Mugabe and his rival chief, Joshua Nkomo, who oppose Prime Minister Ian Smith's minority government in Salisbury.

"We got out in front on delivering the Patriotic Front to a peace conference because Vance promised he would deliver Ian Smith," a key Nigerian official said to an American visitor recently. "Instead, we were left hanging, while Smith went to Washington for a welcome from Vance."

Vance's decision to reverse policy and grant the Rhodesian prime minister a visa in October has led to Mugabe's group calling on the United States to end its "biased" diplomatic involvement beside the British in the Rhodesian crisis.

Although it was scarcely apparent then, the swing toward the bleak out-look and disillusionment of today was beginning even as Mugabe was boarding the personal aircraft of Nigerian head of state Olusegun Obasanjo on Aug. 19 to fly to Lusaka, Zambia, where the Nigerians thought Mugabe would agree formally to a power-sharing arrangement that had been secretly negotiated by Nkomo and Smith five days before.

What happened next is still a matter of sharp dispute and will not be resolved until the veil of secrecy around the wide-ranging contacts is lifted. But interviews with responsible Rhodesian, Nigerian, Tanzanian and American sources provide a first clear outline of the tangled chain of events forged in Rhodesia by big-power diplomacy, guerrilla politics and battlefield results.

The events flow from two early decisions on Africa made by the Carter administration. One was to sponsor with Britain a plan for a peace conference involving Smith's government and the guerrillas. The Anglo-American plan quickly became the controversial focus of the peace-making efforts.

The other decision was to seek much stronger ties with Nigeria and the five frontline states that support the guerrillas. U.S. planners felt they could work with once hostile leaders like Tanzania's Julius Nyerere and Mozambique's Samora Machel, as well as Zambia's Kenneth Kaunda, to promote a settlement that would prevent a repeat in Rhodesia of the bloody fighting between African nationalist groups in Angola once white rule ended there in 1975.

The Angola civil war also entrenched Soviet and Cuban military advisers in that country. Although the Carter administration will not publicly articulate it, another factor in the decision to work actively for a peaceful transition to black rule in Rhodesia has been the hope of cutting off Russian and Cuban influence on the guerrillas.

The U.S. -- Nigerian connection, badly frayed during the Biafra war, was repaired primarily by Andrew Young, the Carter administration's ambassador to the United Nations and its "point man" on African policy. President Carter reinforced the link by an official visit to Lagos this year.

By the spring and early summer, Vance was working closely with Nigeria's energetic foreign minister, Joseph Garba. The guerrillas slowly moved from opposing the Anglo-American plan to accepting it as the basis for negotiations.

And, Aug. 14, when Smith traveled secretly to Lusaka to meet Nkomo and make the deal that British and American planners hoped would end the war, Garba was a participant in the secret get-together.

The Aug, 14 Smith-Nkomo meeting in Lusaka was set in motion by Kaunda, who is a strong supporter of Nkomo. According to Mugabe aide Tekere, secretary general of Mugabe's Zimbabwe African National Union (ZANU), Mugabe and his backers were not informed of the meeting, which has clearly deepened the suspicions between the two guerrilla groups and estranged Nyerere and Machel from Kaunda.

The Nigerians "were prevailed upon by other parties to be there," Tekere said in a lengthy interview in Washington, D.C. "Britain and the United States were involved in promoting that meeting between Smith and Nkomo."

What Smith and Nkomo agreed at the Aug. 14 Lusaka meeting is the murkiest part of the chain of events. But three independent sources say their understanding is that Smith agreed to let Nkomo become president in return for guarantees for the small white minority. Mugabe was to be given a figure-head role as the No. 2 man in the integrated government, according to these sources.

After the Lusaks meeting, Garba collected the top leaders of ZANU and flew them to Lagos, where Obasanjo reportedly delivered a forceful recommendation on Aug. 19 to Mugabe that he accept the deal, and got no argument back from the Moscow-backed guerrilla leader. Euphoric messages zinged from Lagos to Washington and London as Mugabe left for what Tekere says was to have been a second and final meeting in Lusaka with Smith the next day.

That meeting never took place. Mugabe met with his party's executive committee, Tekere disclosed, and decided "that we don't play political games with Smith."

Word of the Aug. 14 Smith-Nkomo encounter began to leak out and Nyerere and Machel were furious, or at least scrambling to appear to be furious, in front of their public opinion, about the failure of Kaunda, the Nigerians, the Americans and the British to tell them about the meeting.

Smith's black allies in Salisbury also began to scream about being abandoned. A month later, Smith was on his way to a highly publicized visit to Washington, and Rhodesian troops were launching punishing raids against guerrilla installations in Zambia.

U.S. officials acknowledge that the Anglo-American plan and the all-parties conference proposal have been put on hold as a result of the swift changes of fortune in Rhodesia. These officials assert that the Anglo-American approach still offers the best hope for resolving the Rhodesian war. They offer no alternative policy.

But the recent changes and the suspicions spun out of the Smith-Nkomo meeting have also splintered the African solidarity that the Anglo-American plan depends on to keep Nkomo and Mugabe together in making peace. Nyerere and Machel have long suspected the British and Kaunda of trying to promote a Smith-Nkomo deal that will split the more moderate Nkomo away from the Marxist Mugabe, and their suspicion now appears to spill over to the Carter administration and perhaps to Nigeria.

Tekere carefully avoided criticizing the Nigerians, who provide the guerrillas with cash, arms, and other support. His comments depicted the Nigerians as having been duped into the operation.

But the hasty retreat the Nigerian leaders beat last week in declaring the Anglo-American plan dead after a visit by Ambassador Young appeared to reflect a feeling that they had been politically damaged in Africa and at home by the reopening of the split within the frontline states, which may now be irreparable. A permanent split would ensure a similar break within the Patriotic Front, and establish the grounds for the ultimate civil war between Nkomo's forces and Mugabe's guerrillas that the Anglo-American plan sought to avoid.