Brazzaville Protocol

The Brazzaville Protocol (Official name; "Agreement between the Government of the Republic of Cuba and the Government of the People's Republic of Angola for the Conclusions of the Internationalist Mission of the Cuban Military Contingent") mandated the withdrawal of Cuban troops from Angola, paving the way for Namibia's independence through the New York Accords. Representatives from the governments of Angola, Cuba, and South Africa signed the protocol on December 13, 1988 in Brazzaville, Congo."
Negotiation.
In 1981, Chester Crocker, U.S. assistant secretary of state for African affairs for newly elected President Ronald Reagan, had developed a linkage policy, tying apartheid South Africa's agreement to relinquish control of Namibia to Cuba's troop withdrawal and peace in Angola.
During the summer of 1986, a first informal meeting was organized by French businessman Jean-Yves Ollivier and French president's counselor for African affairs Jean-Christophe Mitterrand between senior South African, Mozambican and Angolan representatives, in the Kalahari Desert.
On September 10, 1986, Fidel Castro made Crocker's proposal a prerequisite to withdrawal from Angola. The South African government did as well. The Angolan and American governments began negotiating in June 1987, and the Cuban government joined negotiations on January 28, 1988. All three parties held a round of negotiations on March 9 in London. 
Meanwhile, UNITA and South African forces stopped and repelled an MPLA advance on UNITA regions in strongholds in Southern Angola ending with the Battle of Cuito Cuanavale in Cuando Cubango province from January 13 to March 23, 1988. This was the largest conventional battle in Africa since World War II. UNITA and South Africa retreated after a 15-hour battle on March 23 and moved for negotiations. 
On May 3, the South African government joined the negotiations around Crocker's proposal, and all four parties met in June and August in New York City and Geneva. All parties approved an outline agreement of "Principles for a Peaceful Settlement in South Western Africa" on July 20, and agreed to a ceasefire on August 8. The agreement was finally signed on December 13, 1988.