South Africa launched an invasion to topple the MPLA and install the guerilla Jonas Savimbi, leader of the National Union for the Total Independence of Angola (UNITA), the smallest and least popular of the three groups, as a puppet dictator in Angola. Savimbi, a collaborator with the Portuguese dictatorship before Angolan independence, was known for his ruthlessness, terrorism, and hunger for power. An avowed anti-communist who had already aligned with South Africa, Savimbi would have made the perfect Angolan facade for apartheid control.
As the South African troops advanced inside Angola, they made remarkably easy gains through scarcely defended villages that put up little – if any – resistance. But by November 9, Cuban Special Forces had arrived and went immediately to the battlefield. In the Battle of Quifangondo, the Angolans, supported by Cuban troops, made a decisive stand. They turned back the apartheid army and prevented their easy march to Luanda, where that same day the Portuguese military left Angola and Neto declared independence.
American officials claimed that the Soviets masterminded the operation with Cubans acting as their proxies. They couldn’t fathom Castro acting on its own, rather than as Moscow’s puppet. Such claims were repeated for years. American politicians went as far as falsely accusing Cuban troops of being mercenaries. But the record makes clear that these were in reality nothing more than slanderous lies.
The Americans were furious. “Kissinger’s response to Castro’s intervention was to throw mercenaries and weapons at the problem,” Gleijeses writes. 
“In Southern Africa Angola today, more so than a year ago, is the bastion of the fight against the racists and the unquestionable revolutionary vanguard. Imperialism knows this,” wrote Jorge Risquet, head of the Cuban Civilian Mission in Angola to President Neto. “Imperialism has to know what Angola does for Zimbabwe, what Angola does for Namibia, what Angola does for South Africa. Angola, bravely, lends real support to the movements of Namibia, Zimbabwe, South Africa. In concrete terms, nothing less than training in its territory 20,000 combatants from those three countries oppressed by the racists.” 
With the omnipresent threat against Angola, Cuba maintained a large contingent of around 30,000 troops at the behest of the MPLA to prevent another invasion. In a letter to the political bureau of the MPLA after Neto’s death, Fidel wrote of the sacrifice Cuba was willing to make.
Meanwhile, South African aggression was relentless. In 1983, the SADF bombed Angolan towns and pushed nearly 90 miles into Angolan territory. When the UN moved to condemn the invasion, the United States made sure the censure would not include sanctions, as they had done for more than a decade.
Seven years later, the UN Security Council passed Resolution 435 reiterating its objective of “the withdrawal of South Africa’s illegal administration from Namibia and the transfer of power to the people of Namibia.”
As international opinion turned, Castro sensed that apartheid in South Africa would not be able to last much longer. Despite the growing cost to Cuba of maintaining about 30,000 troops in Angola, Castro was confident that he would be able to wait out the inevitable downfall of the racist regime.
Nevertheless, the apartheid government kept up its relentless fight for survival. Throughout the 1980s, Angola was subjected to various incursions and invasions by South Africa. At the same time, the Angolan Armed Forces (FAPLA) fought against former Portuguese collaborator Jonas Savimbi and his UNITA army, who was backed by South Africa and the United States. Savimbi sought to roll back MPLA rule and form an alliance with the apartheid regime.
With the military confrontation raging, talks started between Angola, Cuba and South Africa, with the United States moderating, in London in early 1988. In instructions to the Cuban delegation, Castro reflected on the South Africans and American mindset.
The Cuban Commander-in-Chief’s instructions to his negotiating team show that he fully understood that Cuba stood firmly on the right side of history.
The negotiations would continue throughout the year and lead to the New York agreements in December 1988, which Gleijeses says “led to the independence of Namibia and the withdrawal of the Cuban troops from Angola.” 
Many years later, after the passing of Nelson Mandela, Castro would wonder why after so many years the enablers of apartheid still could not admit the truth.
Since the success of the Cuban revolution of 1959, American policy has always been reflexive opposition to anything Cuba did. Shortly after Mandela’s funeral, Gleijeses wrote an open letter to President Obama that described the actual course of events in Africa during the Cold War:
American officials would, no doubt, prefer that Cuba’s heroic role in defeating apartheid and the U.S.’s shameful role in enabling it be relegated to the ash heap of history. But the historical and documentary record speaks for itself, despite Washington’s attempts to bury it.