Cuban leader Fidel Castro, left, shares a laugh with South Africa President Nelson Mandela at the World Trade Organization held in Geneva Tuesday, May 19, 1998. Mandela and Castro said in separate speeches that the global trading system had failed to achieve its goals of bringing a higher standard of living to many developing countries. (AP Photo/PATRICK AVIOLAT)

Americans generally view Nelson Mandela as a hero and Fidel Castro as a villain. Mandela saw things differently.

The South African leader’s nationalist and anti-imperialist stances collided head on with the world’s superpower and gave him a lot in common with its Cuban archenemy. Mandela embraced the former Cuban dictator because he opposed apartheid and represented the aspirations of Third World nationalists that the United States undermined across the globe during the Cold War.

As it did for many leftists in the Global South, the Cuban Revolution’s triumph in 1959 inspired Mandela. Charged with the task of starting a guerrilla army in 1961, he looked to the writings of Cuban Communists for guidance.

“Any and every source was of interest to me,” Mandela wrote in his 2008 autobiography. “I read the report of Blas Roca, the general secretary of the Community Party of Cuba, about their years as an illegal organization during the Batista regime. In Commando, by Deneys Reitz, I read of the unconventional guerrilla tactics of the Boer generals during the Anglo-Boer War. I read works by and about Che Guevara, Mao Tse-tung, Fidel Castro.”

Mandela’s admiration for the Cuban Revolution only grew with time. Cuba under Castro opposed apartheid and supported the African National Congress -- Mandela's political organization and the current ruling party. Mandela credited Cuba’s military support to Angola in the 1970s and 1980s with helping to debilitate South Africa’s government enough to result in the legalization of the ANC in 1990.

Given this history, it shouldn’t be surprising that Mandela remained sharply critical of the United States into his later life. When the George W. Bush administration announced plans to invade Iraq in 2003, Mandela said: “If there’s a country that has committed unspeakable atrocities in the world, it is the United States of America. They don’t care.”

Shortly following his release after 27 years as a political prisoner in 1990, Mandela visited Cuba to express his gratitude, calling Castro’s Revolution “a source of inspiration to all freedom-loving people.”

"We admire the sacrifices of the Cuban people in maintaining their independence and sovereignty in the face of a vicious, imperialist-orchestrated campaign," Mandela said during the visit, according to the Los Angeles Times. "We, too, want to control our own destiny.”

During a public event in Havana, Mandela asked Castro to visit South Africa.

“Who trained our people, who gave us resources, who helped so many of our soldiers, our doctors?” Mandela said. “You have not come to our country -- when are you coming?”

None of this went down well with the Cuban exile community in the United States, most of whom fled the dictatorship in the early 1960s. Even before Mandela’s visit to Cuba, Castro’s opponents in South Florida fumed over the praise Mandela heaped on the island’s Communist dictator. When Mandela came to speak against apartheid in Miami in 1990, five Cuban-American mayors signed a letter criticizing him for his pro-Castro comments.

The pressure prompted the local government to snub Mandela, canceling an official welcome of the recently released leader.

In response, black leaders boycotted the Miami tourist industry until 1993, according to the Miami Herald.

Despite protest from Cuban Americans and criticism from those who pointed to human rights abuses in Cuba, Castro and Mandela continued their warm relationship, with Mandela saying he wouldn’t turn his back on those who had opposed apartheid. Castro took Mandela up on his offer to visit in 1994, when he traveled to attend Mandela’s inauguration as South Africa’s first black president.

Mandela passed away on Thursday at the age of 95.