The favourites beat Morocco and Egypt in the final vote to become the first African country to host the event.
Fifa president Sepp Blatter made the announcement following a secret ballot of Fifa's 24 executives.
Libya were disqualified before Saturday's voting started.
In making the announcement Blatter said the decision to send the event to Africa was a victory for the entire continent.
SA World Cup delight He said only one round of voting was required to produce a winner.
The South African delegation, including former president Nelson Mandela, erupted in noisy celebrations after finally overcoming the disappointment of losing to Germany by a single vote in the race to host the 2006 World Cup.
Morocco failed in its fourth bid, despite hoping to become both the first African and the first Arab country to host football's showpiece.
Libya had earlier been disqualified after insisting on a joint bid with Tunisia who had pulled out of the race the previous day.
South Africa had been seen as the frontrunners to host the event from the outset and their hopes were boosted even further last week when Fifa released its technical report.
The Fifa inspection team rated South Africa's facilities as the best of the five competing countries.
South Africa's bid was described as "excellent", while those of north African rivals Egypt and Morocco were "very good".
Morocco, who were seen as the main rivals to South Africa, suffered a major blow by having questions raised about the country's lack of infrastructure.