Two-time former champion Roger Federer advanced into quarterfinal in Shanghai Masters after a hard win over Roberto Bautista Agut of Spain 6-3, 2-6, 6-4, while Novak Djokovic tamed Italy's Marco Cecchinato 6-4, 6-0 to join the last eight on Thursday.
"I'm actually quite happy," Federer said. "Bautista really had to raise his level of play in that second set to stay with me. I mean, he really caught fire."
Bautista Agut stunned the Swiss world No. 2 in the second set after he broke three times to force a decider. In the third set, Federer, the 20-time Grand Slam Champion, earned the break at the deciding ninth game and then concluded the match with strong serve to love.
Having edged past Daniil Medvedev and Bautista Agut, The reigning champion of the tournament will next play Kei Nisshikori after the Japanese overcame American Sam Querrey 7-6(7), 6-4.
Earlier in the day, world No. 3 Djokovic, who was defeated by Cecchinato in French Open this year, delivered a completely different performance against the Italian rival in the ATP 1000 showpiece.
The second seed broke four times in the match and held out all his service games without double faults to achieve an easy win in less than 70 minutes.
"I was aggressive when I needed to be. The second set was perfect really. I am really glad to be able to finish the match the way I did," said the 31-year-old Serbian.
Awaiting Djokovic in the quarterfinal is 7th seed of South Africa Kevin Anderson, who saw off the 20-year-old Stefanos Tsitsipas in straight sets 6-4, 7-6(1). The pair will meet once again following the Wimbledon final in July.
The surprising news came from third seeded Juan Martin del Potro, who is suffering from virus and lost his footing on Thursday. He retired from the tournament after losing 7-5 in the first set to send Croatia's Borna Coric to the next round.
In other matches, fourth seeded German young star Alexander Zverev beat Alex De Minaur of Australia 6-1, 6-4 to join the last eight, but his compatriot Alex De Minaur crashed out to Matthew Ebden 6-2, 6-3.