(CNN) -- France's World Cup nightmare finally came to an end in Bloemfontein but hosts South Africa narrowly failed to prevent Mexico and Uruguay progressing from Group A.
Luis Suarez scored the only goal of the game in the battle of the two Latin American teams, but South Africa could not take advantage to pull off a famous turnaround in the group.
The hosts did at least salvage some pride with a 2-1 defeat of France, but they become the first host nation to exit at the group stage in World Cup history.
As for France, their miserable competition is over, but they did at least register their first goal, as Florent Malouda struck to half the deficit.
In a week that saw striker Nicolas Anelka sent home in disgrace, the players refuse to train and two senior officials quit in disgust, coach Raymond Domenech's reign of the national side has now come to an end. Former France captain Laurent Blanc will be his replacement.
Uruguay go through as Group A winners and will now face whoever comes second in Group B -- likely to be Nigeria or South Korea. Mexico will face Argentina if Diego Maradona's side top that group.
South Africa 2-1 France
After a tumultuous week Domenech made six changes to the side that faced Mexico, and dropped captain Patrice Evra from the squad altogether.
It was South Africa who opened the scoring on 20 minutes when Bongani Khumalo bundled home a corner after a flap from France goalkeeper Hugo Lloris. Replays suggested the ball hit the South African player's arm.
Things went from bad to worse for France when midfielder Yoann Gourcuff was sent off for an elbow on Siphiwe Tshabalala.
And the hosts doubled their advantage 11 minutes later when Tsepo Masilela's cross fell to Katlego Mphela who stabbed the ball home at the far post.
Barcelona striker Thierry Henry was finally given a taste of World Cup action in the 55th minute and he flashed a shot wide within moments of his introduction.
But in the 70th minute France finally broke their duck in the tournament as Franck Ribery ran onto Bacary Sagna's pass before squaring to second-half substitute Florent Malouda to tap into an empty net.
Mphela hit the crossbar after a through ball from Tshabalala, and Tshabalala himself came close right at the end when he forced Lloris into a smart save.
At the final whistle an angry Domenech refused to shake hands with South Africa coach Carlos Alberto Parreira and he later told reporters: "The over-riding emotion is one of sadness.
"We would have liked the dream to have continued. I shook hands with the players because we have been through some difficult times together. We need to be dignified in victory and defeat.
"I have had a splendid adventure for the last six years, good times and bad times. It is impossible to summarize at the moment what has happened.
"I cannot analyze things yet. I am not concerned about myself only the French team and its future. Good luck to my successor and the French team. I wish them all the best. I will be their number one fan."
Uruguay 1-0 Mexico
Uruguay and Mexico knew that a draw would send them both through to the second round but with Argentina the likely opponent for whoever finished second in the group, the Latin American sides set out for victories.
Uruguay had an early chance to go in front when striker Luis Suarez sprang the offside trap, only to fire narrowly wide of the post.
Guillermo Franco had the next opportunity as Mexico responded but he failed to make contact with the ball from inside the area.
Andres Guardado then hit the bar for Mexico with a thunderbolt of a shot from 30 yards but just before halftime Uruguay made the breakthrough.
Edinson Cavani got down the left before his pinpoint cross was met at the far post by Luis Suarez, who powered a header into the net.
Veteran striker Cuauhtémoc Blanco had an early chance to draw Mexico level but his free-kick was hit right at Uruguay 'keeper Fernando Muslera.
Then Pablo Barrera created a golden opportunity for defender Franciso Rodriguez, but he nodded tamely wide from the penalty spot.
As the game entered its final stage Uruguay seemed content to hold onto their slender advantage, and Mexico couldn't find the cutting edge to break them down.
But at the final whistle both Latin American teams were through to the second round.