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.
Strong start for Nadal in Acapulco
Rafael Nadal showed no signs of rust in his first action in a month as the top seed easily dispatched Mischa Zverev 6-3, 6-3 at the Acapulco International on Tuesday.
Nadal, competing for the first time since falling to Novak Djokovic in the Australian Open final, has reached the final in all three previous appearances in Acapulco and now has a record of 15-1 in the event.
The World No 2 faces Nick Kyrgios in the round of 16 after the Australian defeated Andreas Seppi of Italy 6-3, 7-5.
Second seed Alexander Zverev lost just one point on serve in a dominant 6-3, 6-3 win over Alexei Popyrin while John Isner, seeded third, recorded 18 aces in a 6-3, 4-6, 6-3 win over France’s Adrian Mannarino. Isner next faces fellow American Sam Querrey, who beat Guillermo Garcia-Lopez 6-3, 6-2.
Fourth seed Diego Schwartzman needed more than two hours to advance past Marius Copil 6-3, 4-6, 6-1. Schwartzman has returned to action after a right leg injury forced him to retire at the Rio Open last week, preventing him from defending his title.
He next faces Briton Cameron Norrie, who defeated Japan’s Yoshihito Nishioka 6-2, 2-6, 6-2.