Roger Federer was made to work hard by Fernando Verdasco before beating the Spanish veteran 6-3 3-6 6-3 on Wednesday to reach the quarter-finals of the Dubai Duty Free Tennis Championships.
Federer, who is looking to claim his 100th ATP title, was dragged to three sets for the second time in as many rounds but came through in the decider for his 50th victory in Dubai.
"Even though I wasn't playing my best, I still felt like it was going to fall my way when it really mattered," said Federer, who could become the second man in the Open Era to win 100 titles after Jimmy Connors (109).
"I think that confidence is important. I'm happy I had it today... I played good at the end. I had the serve when I needed it, had some good shots... that was nice to win it that way."
The 20-times Grand Slam champion next faces Hungary's Marton Fucsovics who beat Jan-Lennard Struff 6-4 6-2.
Earlier, Polish qualifier Hubert Hurkacz upset top seed Kei Nishikori 7-5 5-7 6-2 for his first win over a top 10 player.
Hurkacz converted six out of seven break points to beat his Japanese opponent, ranked sixth, in a little over two hours.
"Kei is an unbelievable player. I had to serve good. That gave me opportunities to attack after the serve and also win a couple of easy points," world number 77 Hurkacz said.
"Against such a great player, it's important to have some free points. I was also returning quite well. The match was a little up and down. But I'm happy with the win today."
Hurkacz set up a meeting with Greek Stefanos Tsitsipas after the Australian Open semi-finalist swatted aside Egor Gerasimov 6-3 6-1 to advance.
Defending champion Roberto Bautista Agut of Spain edged a tight first set against Nikoloz Basilashvili but then faltered as his Georgian opponent prevailed 6-7(2) 6-4 6-3.
World number 113 Ricardas Berankis, who stunned eighth seed Daniil Medvedev on Tuesday, continued his fine form with a 6-4 6-1 victory over American Denis Kudla.
The Lithuanian qualifier will face Frenchman Gael Monfils who eased past Marcos Baghdatis 6-3 6-2.
(Reporting by Shrivathsa Sridhar in Bengaluru; Editing by Christian Radnedge and Ken Ferris)
For more sports coverage, visit the ABS-CBN Sports website.