Argentina's Juan Martin del Potro claimed a surprise 7-6 (7/3), 4-6, 6-3 victory over defending champion Roger Federer on Saturday to book his place in the semi-finals of the ATP Tour Finals.
Del Potro's victory ended Federer's 12-match winning run at the season-ending event and guaranteed he will qualify from Group B along with the Swiss star.
Federer, who has won the Tour Finals title for the last two years, already knew he was through after winning his first two group matches at London's O2 Arena.
The semi-final match-ups will not be decided until after the final group match between David Ferrer and Janko Tipsarevic later on Saturday.
Victory for Ferrer would mean it is Federer who plays Andy Murray with del Potro playing Novak Djokovic, while a Tipsarevic win would reverse the fixtures.
Federer had won 13 of his previous 16 meetings, but the Argentine has given him plenty of trouble at times.
As well as winning his only Grand Slam title with a win over Federer at the 2009 US Open, del Potro also handed the 31-year-old his only other indoor defeat in the last two years in the final of his hometown tournament in Basle last month.
That pattern continued as a tight first set saw sixth-seeded del Potro save three break points to keep Federer at bay.
Then in the tie-break, Federer suddenly lost his rhythm and del Potro took advantage to snatch the first set.
Federer made a strong response, reeling off eight successive points to break at the start of the second set, and that was enough to level the match.
But del Potro's big-hitting style blew Federer off course again in the deciding set.
The 17-time Grand Slam champion was unable to survive the barrage and del Potro broke for a 2-0 lead before holding his nerve to serve out a superb win in two hours.