Nehra underwent the operation in a Pretoria hospital, his mother said. "His operation went off well," she said. "He spoke to us just now and he is fine."
The 23-year-old is expected to take at least a month to recover, but the Indians do not play any more international cricket until they host New Zealand in October.
Nehra badly injured his left ankle when he slipped and fell on his bowling stride in a league match in the World Cup against Namibia. But he continued to bowl, and superbly at that, in the tournament with a heavily strapped ankle to finish with 15 wickets at an average of 19.26 runs.
Nehra, however, opted out of the TVS Cup one-day series in Dhaka to undergo surgery on his ankle.
Top batsman Sachin Tendulkar will also have an operation later this month to rectify a bone injury in his left hand.