Novak Djokovic was left sweating on a place in the semi-finals of the ATP World Tour Finals on Friday after losing for the first time in his career to fellow-Serb Janko Tipsarevic.
The world number one looked on course for victory when he cruised through the first set of his final Group A match but was outplayed after that in a 3-6, 6-3, 6-3 defeat.
Djokovic ended with one win and two defeats in round-robin play and needs Spain's David Ferrer, who is already guaranteed a place in the semis, to beat Tomas Berdych later at the O2 for him to scramble into the last four.
If Berdych beats Ferrer the Czech would win the group with Ferrer runner-up.
Knowing he required a handsome win to put maximum pressure on Berdych later, Djokovic locked straight into his rhythm from the baseline and broke to lead 3-1 on his way to the opening set.
World number nine Tipsarevic, playing his second match after stepping in for the injured Andy Murray, managed to stay with his Davis Cup team mate in the second set although he was made to work overtime on his service games.
Djokovic, who labelled his poor showing against Ferrer his "worst match" of an incredible season, treated another large crowd to some trademark winners from impossible positions, including one perfect topspin lob.
Tipsarevic, who lost to Berdych on Wednesday despite having a match point, began to strike the ball with more venom and broke for the first time to lead 4-2 when an ambitious Djokovic dropshot attempt landed in the net.
Suddenly a match Djokovic appeared to have firmly under control began to unravel and, although he broke back immediately, Tipsarevic seized on some errors in the next game to regain the advantage and then held serve to set up a deciding set.
Tipsarevic carried his momentum into the third set and broke with an angled winner after dragging Djokovic to the net with a drop shot.
Djokovic never looked like recovering and by the end he looked almost uninterested, ending the contest when he buried a forehand into the net.