Highlights: France 1-2 South Africa
South Africa made the country proud by beating 10-man France in their final group game, said Carlos Alberto Parreira, coach of the World Cup hosts.
The 2-1 win was South Africa's first of the tournament but was not enough to stop them becoming the first ever host nation to go out in the group stages.
"I am proud of the boys. They made this country proud," said Parreira.
Uruguay beat Mexico 1-0 to finish top of Group A, meaning the Mexicans qualify in second on goal difference.
South Africa did their utmost against a dispirited French side to seal a place in the last 16, but it was not to be as they finished level on four points with Mexico but three goals worse off than El Tri.
Turmoil has engulfed the French camp this week but despite Les Bleus' off-field problems, Parreira said the hosts' victory over the 2006 finalists was a clear sign of Bafana Bafana's improvement.
"We can't see this as a failure," he said. "We never talked about progressing to the next round, everyone knew it was one of the toughest groups in the World Cup.
"In the end, we just missed out on goal difference and if we had a little bit of luck it could have been different."
There was an unsavoury end to proceedings when French coach Raymond Domenech refused to shake hands with Parreira at full-time, leading to an exchange of words between the two.
"One of his assistants said I had commented on Thierry Henry's handball [in a play-off victory over the Republic of Ireland] and that France should not be in the finals but I do not recall making these remarks," stated the Brazilian.
Parreira, who returned for a second spell as South Africa coach in October 2009, having previously being in charge between 2007 and 2008, will now step down from his role with the team as planned for family reasons.
"I feel at home here. In my heart deeply I will always remember this country," he added. "These boys, what they did for me in preparation they were unbelievable.
"I just want to say thank you to these people."
Parreira explains Domenech snub
Bongani Khumalo's header from a corner and a bundled finish from Katlego Mphela gave South Africa a 2-0 half-time lead against France, who had Yoann Gourcuff controversially sent off for an elbow on Macbeth Sibaya between the goals.
However, they could not make their numerical advantage count in the second half and French substitute Florent Malouda's consolation goal ended their hopes of qualification.
"We really knew what we had to do today and obviously getting an early goal helped us a lot," said Khumalo. "It was important that we carried the momentum on.
"I really thought we could pull through."
Steven Pienaar, who played in all three games for the hosts, added: "The most important thing is that we ended the tournament on a high note.
"We are happy to say goodbye to the supporters in a good way."
Striker Katlego Mphela, who struck the woodwork against the French and in the closing stages of their opening defeat to Mexico, said the country had reason to be proud of its football team.
"We gave our best," he said. "We were a bit unfortunate that we missed a couple of chances. But a win against France in the World Cup makes history."
France finished bottom of Group A with only one point to bring an end to their miserable campaign.
The French camp has been in disarray, with players refusing to train on Sunday following the decision to send striker Nicolas Anelka home for criticising coach Domenech, while captain Patrice Evra was dropped for the game against South Africa.