Nelson Mandela will be celebrated principally for the dignity with which he emerged onto the world stage after decades in prison and for the forgiveness that he displayed towards his former enemies in forging a democratic, multi-racial South Africa from the poisoned legacy of apartheid.

As a global statesman of grace and humility, he was long courted by western leaders drawn by his irresistible story of triumph over tyranny. Yet Mandela, who died on December 5 at age 95, was also a more radical and politically complex figure than has been commonly acknowledged by his admirers in the West.

As a young man he had close ties to the South African Communist Party and plotted an armed uprising inspired by Fidel Castro's 1959 revolution in Cuba.

For many who followed his life closely, that commitment to socialist values and instinctive solidarity with those he saw as fellow strugglers against oppression, colonialism and imperialism continued to burn strongly even in the years after his release from prison and the end of apartheid.

"He came out of prison a senior statesman in waiting. He went into prison as a militant revolutionary leader," Peter Hain, a veteran anti-apartheid campaigner and friend of Mandela's, said. "He was seen as a burly freedom fighter, learning how to shoot in Ethiopia and travelling to revolutionary Algeria and other countries while he was underground. We must never forget he was a freedom fighter."

Mandela's legacy on race stirs S Africa youth

Young radical

Stephen Ellis, a professor of African history at VU University and the African Studies Centre in the Netherlands, believes that many people with only a vague awareness of Mandela's struggle against apartheid are simply not aware of his youthful radicalism and commitment to violent means.

Mandela always denied being a card-carrying convert to Communism. But Ellis, in his most recent book, External Mission: The ANC In Exile , claimed to have uncovered documentary proof suggesting otherwise, albeit suggesting Mandela was more interested in securing support from Moscow or Beijing, rather than being a "heart and soul believer".

"If you talk to many American liberals, they think Mandela was Martin Luther King," Ellis said. "If you say, 'No, Mandela started a guerrilla army, he was a Communist, he did this, he did that', they just don't get it. They don't know what you're talking about."

Yet even later, as South African president from 1994 to 1999, Mandela would irk his friends in the West by expressing solidarity with leaders such as Cuba's Castro and Libya's Muammar Gaddafi, as well as finding common cause with the Palestinians in their struggle for statehood.

At a banquet in 1998 honouring Yasser Arafat, the then-Palestinian president, Mandela said: "You come as a leader of a people who have shared with us the experience of struggle for justice. Now that we have achieved our freedom, we have not forgotten our friends and allies who helped us liberate ourselves."

Visiting Libya a year earlier, Mandela had greeted Gaddafi with a kiss on each cheek and said: "My brother leader, my brother leader, how nice to see you."

Yet it was the Cuban revolution that held the highest place in his affections, a bond made stronger by his enduring friendship with Castro. On a visit to the Caribbean island in 1991, Mandela paid tribute to Che Guevara, calling his revolutionary exploits "too powerful for any prison censors to hide from us. The life of Che is an inspiration to all human beings who cherish freedom."

David James Smith, author of Young Mandela , said: "He was very much inspired by the revolution in Cuba. He was studying what was going on in Cuba with a view to using that as a model for revolutionary activity in South Africa."

Mandela's gratitude extended to other members of the bloc of Communist nations that had backed the struggle against apartheid. In a speech in 1991 he also singled out the Soviet Union, East Germany and China for special mention, even as the political landscape of eastern Europe was being redrawn in the aftermath of the Cold War and despite Beijing's crackdown on pro-democracy protests in 1989.

Out of touch

Ellis believes that Mandela, whose worldview was fundamentally shaped by the national liberation struggles and Cold War tensions of the 1950s, was essentially out of touch with the world in which he found himself on leaving prison in 1990.

In a speech after his release, Mandela had reiterated the African National Congress' commitment to the nationalisation of banks, mines and industries at a time when free market economics was sweeping all before it.

"It was greeted with total horror, because nobody, even on the left, by 1990 was advocating state ownership of industry. That was all associated with a brand of socialism that had failed," said Ellis. "He clearly knew almost nothing about the contemporary world. Before he had gone to prison he was very pro-Soviet. When he comes out of prison the world had changed and he had difficulty recognising it."

Yes, he would go and do business with the West, but ideologically he would always be first with Castro and independence leaders in Africa. - David James Smith, author of Young Mandela

As a consequence, Ellis said, the ANC leadership steered Mandela away from government and party affairs even when he was South African president.

Instead, they preferred to use his moral standing and considerable charm as a focus for unity within both the highly factional ANC itself and wider South African society, and for fundraising and publicity purposes by having him pose for photos with the likes of Naomi Campbell and the Spice Girls.

But Mandela, even after leaving office in 1999, remained fiercely outspoken in condemning what he saw as flagrant western imperialism. In 2003 he lambasted the United States and the United Kingdom for "attempting to police the world" over their military intervention in Kosovo in 1999 and the invasion of Iraq, even suggesting that moves to undermine the United Nations were motivated in part by the rise of a black African, Kofi Annan, to the office of secretary general.

He also urged US citizens to take to the streets in protest at moves to attack Iraq, accusing US President George W Bush of wanting to "plunge the world into a holocaust".

"If there is a country that has committed unspeakable atrocities in the world, it is the United States of America," he added.

Hain, then a minister in Tony Blair's British government, recalls Mandela phoning him up at the time of the build-up to the invasion of Iraq as angry as he had ever heard him.

"He was just very angry and worried," Hain said. "But I fully understood why; he is a man of principle. He would do things that offended the Bill Clintons and the Tony Blairs, like he would say to Fidel Castro, 'Thank you for supporting us', and visit Cuba, or he'd do the same to Gaddafi in Libya."

Smith believes Mandela would have been deeply uncomfortable with efforts to deradicalise his legacy by portraying him in bland terms as simply an inspirational and reconciliatory figure.

"There are many people around him who believe he has been devalued by the use of his celebrity," he said. "He stood for very firm anti-racist, anti-imperialist, anti-colonialist values. Yes, he would go and do business with the West, but ideologically he would always be first with Castro and independence leaders in Africa. First and foremost, he was a black African and that was where his heart and his politics lay."