Andy Murray will this morning be contemplating a shock end to his season after one of tennis' strangest nights.
The British number one had left the O2 Arena yesterday thinking a place in the last four of the Barclays ATP World Tour Finals was all but assured after his 6-4 6-7 (4/7) 7-6 (7/3) victory over Fernando Verdasco.
The permutations that would have denied him seemed unlikely: Juan Martin del Potro had to beat Roger Federer in three sets and by such a scoreline that those two players would have a better games percentage than Murray.
Incredibly that is exactly what transpired, with Del Potro taking the second semi-final spot by virtue of having won 45 games and lost 43 while Murray's record was 44-43.
The Scot looked safe at 3-3 in the decider, Federer needing only to win another game to eliminate Del Potro. And it looked even better when he engineered three break points on the Argentinian's serve.
But amazingly those slipped away and the world number one was promptly broken before Del Potro served out the 6-2 6-7 (5/7) 6-3 victory with an ace.
The margins - only 0.5% separated the pair - were so small that none of the three players, or the packed O2 Arena, knew the outcome and it took almost half an hour for the ATP to confirm Del Potro's progress.
Murray said on Twitter: "Anyone know what's going on?? I think I'm (out) but the rules aren't worded too well."
Earlier, the 22-year-old had defended the round-robin system, saying: "I don't actually think that it's that complicated but everyone makes it sound so complicated. The people that go through are the ones that deserve to."
Whether Murray feels the same this morning is perhaps doubtful but he will almost certainly be reflecting on the manner of his victory over Verdasco, where he had 13 break points but took only one and eventually needed a third-set tie-break to secure victory.
Federer, although expressing some sympathy for Murray, felt he was partly the architect of his own downfall.
The world number one said: "I definitely tried to push myself to close out matches as quickly as I can against fellow rivals because you never know when you might need those games. You always have to push yourself. The system is the way it is."
Murray, though, credited Verdasco for raising his game on the big points.
He said: "Maybe on two or three of them I had opportunities to do a little bit more with my return. Unfortunately, I can't play great on every point. But he came up with great shots and great serves."
For Del Potro it was a second victory over Federer on the big stage, two and a half months after he beat the world number one in the final of the US Open.
And the Argentinian had no regrets about knocking out the home favourite, saying: "This is the sport. Just two players have to qualify. Maybe for the local public it is bad to not have the opportunity to see Murray in the semis, but they will see Federer and other good players."
The calculators could be back out at the O2 today for the conclusion of Group B, although there is only one place to play for after Robin Soderling qualified on Wednesday.
Rafael Nadal is already eliminated so the final spot will go to either Novak Djokovic, who takes on Nadal this afternoon, or Nikolay Davydenko, who plays Soderling in the evening match.