Halle Westfalen - World number one Roger Federer kept his quest for a 10th Halle grasscourt title alive by saving two match points to defeat France's Benoit Paire 6-3, 3-6, 7-6 (9/7) and make the quarter-finals on Thursday.
Federer will face Australia's world number 60 Matthew Ebden, who defeated Germany's Philipp Kohlschreiber 4-6, 6-1, 6-2, for a place in the semi-finals.
Federer's preparations in the build-up to the defence of his Wimbledon title had been running smoothly, with a title last week in Stuttgart and a solid opening Halle win for the top seed.
It was a tough fight on Thursday, however, with the 36-year-old missing two match points in the final-set tiebreak and then saving two for Paire.
The top seed finally won on his third match point when Paire returned long.
"You need to take the right decisions along the way," Federer said of the dramatic tiebreaker. "You need some luck also, I guess.
"It was a tough match played at good level. He served well and was hard to break.
"It was always going to be tight. At the end it was extremely close, I was fortunate to have made it today."
Federer, who won the opening set with back-to-back aces, fell 4-0 down in the second set as Paire rallied.
The Swiss got one of the breaks back but could not work his usual magic as the contest was squared at a set each.
The victory in just under two hours left Federer with a perfect 6-0 record over Paire, who angrily slashed his racquet across the grass in moments of desperation, drawing jeers from the crowd.
"I created quite a few opportunities, but maybe I was a bit tentative at times," Federer said. "I was disappointed with my serve in the second set, being broken twice.
"That is not allowed to happen, I need to clean that up. But it was not a bad match for me."
Had he lost on Thursday, Federer would have surrendered the world top ranking to Rafael Nadal at Wimbledon.
However, his escape act against Paire means he has now won 18 straight matches on his favoured grass surface, a run of success dating back a year.
Federer is seeking a 99th career title this weekend and could possibly be playing for his 100th at Wimbledon next month, where he has won eight of his 20 Grand Slam trophies.
Ebden reached the semi-finals in the Netherlands last week, where he lost to Jeremy Chardy.
The Australian needed just over 90 minutes to beat Kohlschreiber, the 2011 title winner in Halle. The Aussie fired seven aces while breaking four times.
Kohlschreiber is usually strong in his homeland where he is 121-64 with five of his eight ATP titles coming in Germany.
In other second-round matches, Croatian Borna Coric beat Nikolaz Basilashvili 6-4, 6-2 while Italy's Andreas Seppi put out former champion Florian Mayer of Germany 6-2, 6-4.
Results at the ATP tournament in Halle on Thursday (x indicates seed):
Roger Federer (SUI x1) bt Benoit Paire (FRA) 6-3, 3-6, 7-6 (9/7)
Matthew Ebden (AUS) bt Philipp Kohlschreiber (GER x6) 4-6, 6-1, 6-2
Andreas Seppi (ITA) bt Florian Mayer (GER) 6-2, 6-4
Borna Coric (CRO) bt Nikoloz Basilashvili (GEO) 6-4, 6-2