One of the longest and bloodiest civil wars in Africa, the 16-year struggle in Angola, appears to be coming to a peaceful end, mostly because the Soviet Union and the United States agreed earlier on that goal.

This is a victory for sanity and is one of the fruits of the supposed end of the Cold War - despite the failure of the Gorbachev government to follow through on many of its other hoped-for reforms.Since 1975 - the year Angola gained independence from Portugal - U.S.-backed guerrillas have fought a Cold War battle with the Soviet-backed Marxist regime that had seized power.

Some 300,000 people died in the fighting and up to 50,000 Cuban troops have been stationed in the country to help prop up the leftist government. South African soldiers also had been involved on the side of the guerrillas.

The new peace pact calls for:

- A cease-fire at the end of May to be monitored by a United Nations force. Washington and Moscow are to stop arming the rivals. Cuban troops already are being withdrawn under an earlier arrangement and should be out of the country by June 30.

- Multiparty elections from September to November 1992. The government recently dropped its espousal of Marxism and passed legislation allowing competing political parties.

- Combining of government and rebel forces into a single army. Military personnel are to cut political links.

- During the transition, the existing government is to remain in power, while a joint commission of America, Soviet, Portuguese and rebel and government representatives supervise election preparations and integration of the armed forces.

All of this seems to contain considerable safeguards against treachery and further fighting. Much will depend on the elections and the willingness of popularly chosen officials to function in democratic fashion after outsiders leave the country.

Angola has an advantage over many other African nations. It possesses rich mineral resources, including oil. It has the potential of becoming one of Africa's wealthy countries.

The Cuban withdrawal is part of a 1988 deal in which South Africa ended its involvement in Angola and granted independence to neighboring Namibia. That diplomatic triumph - and the desire of the Kremlin to get out of expensive overseas entanglements - led to U.S.-Soviet efforts to end the fight in Angola. Eight rounds of talks, hosted by Portugal, lasted more than a year.

The agreement is a clear example of what can be accomplished when there is good will, a common objective, and sincere cooperation between the United States and the Soviet Union. May there be many more such examples.