(Reuters) - Top seed and defending champion Roger Federer battled past in-form Russian Daniil Medvedev 6-4 4-6 6-4 to reach the last-16 at the Shanghai Masters on Wednesday.
Federer, playing his first Tour-level match since suffering a shock fourth-round defeat by John Millman at the U.S. Open last month, broke Medvedev twice to take the opening set.
Fresh off the biggest title of his career in Tokyo, Medvedev saved a break point early in the second set and that gave him momentum to grab a break of his own to force a decider.
Both players failed to take their opportunities to take an early lead in the final set before two unforced errors from Medvedev handed Federer a break in the ninth game.
The 37-year-old Swiss served out the match in just under two hours to keep hopes of a third Shanghai title alive. He will next face Spain's Roberto Bautista Agut, who beat American Mackenzie McDonald 3-6 6-4 6-1.
Fourth seed Alexander Zverev edged one step closer to qualifying for next month's ATP Finals after a hard-fought 7-5 6-4 win over in-form Georgian Nikoloz Basilashvili.
The 21-year-old German fought off a cold and showed great confidence to wrap up the victory at the Qi Zhong Stadium.
"I played a solid match. I did everything that I needed to win," said Zverev.
"As you can probably hear in my voice, I'm a little sick right now, so feeling a little bit low energy, but I hope it will get better over the next few days."
Argentine Juan Martin del Potro overcame a slow start to outlast France's Richard Gasquet 7-5 7-6(7).
Third seed Del Potro won four straight games from 3-5 down in the opening set before recovering from 2-6 deficit in the second set tiebreak to set up a third round meeting with Croatian Borna Coric.
Wimbledon finalist Kevin Anderson fired 14 aces to breeze past Kazakh qualifier Mikhail Kukushkin 6-3 6-2.
(Reporting by Hardik Vyas in Bengaluru)