Updated

US President Barack Obama on Sunday will visit Nelson Mandela's apartheid prison cell, paying homage to the ailing South African hero whose humbling forgiveness of his oppressors inspired the world.

The journey to Robben Island, while not Obama's first, will carry extra poignancy with Mandela still critically ill in hospital.

The 94-year-old spent two thirds of his 27 years as a political prisoner on the rocky outcrop off Cape Town.

Subjected to degrading treatment in "the harshest, most iron-fisted outpost in the South African penal system", Mandela was allowed one visitor for 30 minutes, and one letter, every six months.

He did not so much as touch the hand of his then-wife Winnie, having instead to settle for rubbing his nose against a photograph.

But he had vowed not to be robbed of his dignity.

"There were many dark moments when my faith in humanity was sorely tested, but I would not and could not give myself up to despair," Mandela wrote in his autobiography Long Walk to Freedom.

"That way lay defeat and death."

Now a magnet for tourists and a UN World Heritage site, the prison has been starkly preserved as a monument to the hardships endured by those who fought for multi-race democracy.

Tourists arrive by the same method used by prisoners, on ferries that ply across the often moody Atlantic Ocean, a journey that Mandela first made in chains.

Security fences are still topped with angry razor wire.

The bleak quarry where inmates once laboured remains, and the view of scenic Cape Town across the bay painfully close.

But it is the bare-boned former cell of former prisoner 466/64 -- who went on to lead South Africa into multi-race democracy nearly 20 years ago -- that strikes most visitors.

His bed on the floor, a small wooden bench, and a metal toilet bucket have been recreated in the damp space that Mandela could pace across in three steps.

"I was forty-six years old, a political prisoner with a life sentence, and that small cramped space was to be my home for I knew not how long," he wrote.

A window shuttered by thick bars in his cell offered a view into a courtyard where prisoners once broke rocks and where a draft of his autobiography was buried for safekeeping.

Obama visited the cell while a senator in 2006, solemnly gazing out of the same bars that his hero once did.

"Think about 27 years in prison. Think about hardships and the struggles and being away from family and friends," Obama said at a university in Soweto Saturday.

Mandela was sent to the island chained to other prisoners in the hold of an old wooden ferry with a porthole above through which the warders urinated.

Mandela went on to two more prisons before walking free, fists clenched, in 1990 and embracing his former enemies in a globally admired lesson of reconciliation.

He later described the island as a "celebration of the struggle and a symbol of the finest qualities of the human spirit, rather than as a monument to the brutal tyranny and oppression of apartheid".