A South African climber had his foot amputated after trapping it between rocks after and waiting almost 50 hours to be freed in a desperate ordeal.

Tsenolo Shadrack Rasello was climbing in the dangerous Magaliesburg mountain range near Johannesburg when he got stuck, in scenes reminiscent of Hollywood film 127 Hours.

Rasello managed to call for help with his mobile phone, and medics arrived by helicopter were forced to perform the operation to free him.

The 26-year-old had been climbing the mountain range when he was startled by a snake and slid down between two rocks.

He told rescuers he had been searching for water on the mountain, which is believed to be a holy site.

"There is no amount of explaining that can really explain the predicament this fellow was in," said Rob Thomas of the Mountain Club of South Africa, who led the rescue team.

'It was way, way, way worse than what I envisioned,' he told the Daily Telegraph. Rasello called for help on Friday, 19 September.

Rescuers found him dehydrated and terrified after abseiling down the side of a mountain the following day. Initially, rescue workers tried to free Rasello by pulling on the leg, and hacking at the rock.

"Listen, if you have to take the leg off, take the leg off. But get me out of here,'" is what he is said to have told the team.

trauma surgeon amputated the man's leg with the aid of paramedics and an anesthetist, working in treacherous conditions, with a deadly rock fall possible. He was then taken to the Chris Hani Baragwanath Academic Hospital in Johannesburg, where his condition is said to be stable.

The 2010 film 127 Hours, starring James Franco, was inspired by the story of climber Aron Ralston, who severed his own arm after becoming trapped while climbing in Utah.