(CNN) -- Juan Martin del Potro ended Andy Murray's hopes of progressing to the semifinals of the ATP World Tour Finals with a 6-2 6-7 6-3 victory over Roger Federer at the O2 Arena in London.
Following the British number one's victory over Fernando Verdasco, the only scenario that could see Murray miss out was a Del Potro win in three sets.
That would then see the three players tied on match wins and sets won and lost, with the semifinalists decided on percentage of games won.
And it all came down to one game, with Federer winning the group and Del Potro pipping Murray courtesy of his 45 games won to 43 lost, while the Scot's record read 44-43.
The world number five showed in his tremendous victory over Federer in the U.S. Open final in September what a danger he could be and he was immediately on the offensive on Thursday.
But he had a slice of luck -- a desperate defensive shot catching Federer out when it clipped the top of the net -- but there was nothing fortunate about the way he pounded the Swiss star's backhand with ferocious groundstrokes to break in the first game.
And, instead of a Federer fightback, it was Del Potro who broke again to go 4-1 up, an incredible rally in which he simply out-hit the four-time champion followed by a double fault on break point.
Federer opted to go on the attack but he was having to play some superb tennis of his own just to stay in contention.
And Del Potro did not falter serving for the set, clinching it when another big serve drew the error from his shellshocked opponent, who knew a straight-sets defeat would end his semifinal hopes.
It was the Argentine who was left cursing the net in the opening game of the second set when a Federer volley on break point dribbled over but there was no doubt the world number one was rattled.
Del Potro was not only playing with power but with intelligence, pinning Federer on his less-favored backhand and not allowing his opponent to outmanoeuver him.
The 21-year-old, who had never beaten Federer in six attempts prior to the U.S. Open, has struggled with form and fitness since that triumph, winning only three matches, while he was inconsistent against both Murray and Verdasco.
But there was no let-up on Thursday, and he took the set to a tie-break without giving Federer even a sniff of a break point.
He gained the first mini-break with a superb pass but Federer was not finished, powering a forehand winner of his own.
Del Potro forged ahead again, leaving him two serves for a stunning win, but for the first time he tightened up, netting on both, and Federer duly stole the set, leaping with delight as he raced back to his chair.
Del Potro sat with his head in his hands at the change of ends, knowing what a chance he had let slip through his fingers.
But he did not carry the disappointment into the decider and opened up with a love game.
Federer was still some way short of his best, particularly on his returns, but an opening finally came on the Del Potro serve at 3-3. Three break points came and went, though, the last saved by a 112mph second serve.
Had Federer broken that would have sent Murray through at the expense of the Argentinian but it was about to get much worse for the British number one as a terrible game from Federer handed Del Potro a break.
Suddenly the world number five needed only to serve out the match to reach the last four, and he did just that, completing the victory with an ace.