The country got more votes than rivals Morocco and Egypt. The result was announced by Fifa president Sepp Blatter on Saturday morning.
South Africans cheered and jumped for joy when they heard the news.
The event will be the biggest they have ever staged and promises to make tonnes of cash for the country. The next World Cup is in Germany in 2006.
The last footie World Cup was held in Japan and South Korea in 2002. The winners were Brazil.
Meanwhile, loads of European nations are counting down to the start of the Euro 2004 championships next month.
England are among the teams who have qualified for the competition, being held in Portugal.