Tomas Berdych came within inches of a second consecutive defeat at the ATP World Tour Finals on Wednesday but rode his luck to beat Serbia's Janko Tipsarevic 2-6 6-3 7-6 at the o2 Arena.
Tipsarevic, who replaced Andy Murray in the draw after the Briton withdrew with a groin injury, ended the day with problems of his own after apparently hurting his knee towards the end of the match.
Czech Berdych found himself in deep trouble when Tipsarevic crept into the net at 6-5 in the deciding-set tiebreak but, with victory seemingly within his grasp, the Serbian put a backhand volley agonisingly wide of the sideline.
World number nine Tipsarevic then served a double fault to give Berdych his first match point.
The Czech world number seven had another slice of fortune when his opponent stumbled while trying to return serve.
Although his shot landed in court, Tipsarevic tumbled to the court again and was still flat out as Berdych calmly put the ball away into the empty court to end any hope the Serbian had of reaching the semi-finals.
Berdych had never fared too well against Tipsarevic on the Tour and trailed 4-1 in their head-to-heads, although he did beat him at this month's Paris Masters, a victory that guaranteed his qualification for the season-ender.
He looked to be heading for another defeat when the first set slipped by in 37 minutes but he gradually found the range on his forehand to level the match.
The deciding set was a tense battle which always looked like being decided by a tiebreak. Berdych moved 5-3 ahead in the breaker but a couple of nervy forehand errors had him on the brink of defeat until Tipsarevic crumbled.
Later on Wednesday, world number one Novak Djokovic can join Roger Federer in the semi-finals by beating Spain's David Ferrer. Should Djokovic win, Berdych would then need to beat Ferrer in his final Group A match to reach the semi-finals.