Roger Federer came close to suffering three successive losses for the first time in five years before scrambling to a 6-7, 7-6, 6-0 win over Robbie Ginepri at the Cincinnati Masters Series on Tuesday.
Federer was staring defeat in the face when he lost his serve to go 5-6 down in the second set, but Ginepri, an American ranked down at 64 in the world, did not quite have what it took to close the match out.
Had he done so it would have left the door open for Rafael Nadal to end Federer's record four-and-half year reign as world number one this week.
Instead, Federer limped on into a second set tiebreak which he won only after 12 tense rallies when Ginepri hit a not too venomous forehand drive from the Swiss back across court and just wide.
It may nevertheless have strengthened Nadal's belief that he can take over as number one quite soon, and possibly still this week. If Federer fails to reach the semi-finals and Nadal wins the tournament, it will still happen.
"I enjoy the challenge of being number one in the world," Federer said, despite his scare. "I like that. I would rather be me than him.
"I have had a great run so far, and although I have been disappointed that my hard work has not paid off with a Grand Slam win, I am over it now."
Federer created many opportunities to win rallies which he could not take, and crucially could not convert three break points at 4-3 in the second set, when he had Ginepri floundering in wider and wider positions.
Each time the American, who came close to beating Federer here in the semi-finals three years ago, managed to get the ball back just one more time, and long enough for an anxious Federer to make a mistake.
This match followed Federer's loss of the Wimbledon title to Nadal in the final three and a half weeks ago, and a shock opening round loss to Frenchman Gilles Simon in Toronto last week.
Federer broke immediately at the start of the final set and the danger was over. He accelerated to 4-0, and by the end of the contest, his release of tension was palpable.