Shanghai - Reigning champion Roger Federer was pushed all the way for the second match in a row before beating Roberto Bautista Agut to squeeze into the Shanghai Masters quarter-finals on Thursday.
The top seed and 20-time Grand Slam winner emerged from another nervy battle to eventually defeat the 28th-ranked Spaniard 6-3, 2-6, 6-4.
He will play the Japanese eighth seed Kei Nishikori in the last eight, while Novak Djokovic and Alexander Zverev are also through, albeit with far less hassle.
The 37-year-old Federer had been forced to fight in his opening match on Wednesday, admitting that he came "very close" to defeat against Russia's Daniil Medvedev.
Normal order appeared to have been resumed when the Swiss comfortably claimed the first set against Bautista Agut.
But the unseeded Spaniard earned a piece of personal history after that, winning the second set - the first time he had ever done that against the Swiss maestro.
The 30-year-old Bautista Agut had the whiff of an upset in his nostrils and the prospect of a first victory over the Swiss at the eighth attempt.
But in the ninth game of the deciding set, Federer made the breakthrough on his opponent's serve, pumping his fist as another hard-won victory loomed into view.
Djokovic enjoyed a measure of revenge as he booked his spot in the quarter-finals with a 6-4, 6-0 demolition of Marco Cecchinato.
The Serbian second seed was stunned by the Italian - ranked 72 in the world at the time - in the French Open quarter-finals earlier this year.
It was part of a wretched run of form Djokovic suffered in the first half of the year after elbow surgery in February.
But the world number three exploded back to life mid-season, winning Wimbledon, the Cincinnati Masters and US Open.
The 31-year-old, who is now gunning for Rafael Nadal's number one ranking, says he is back close to the kind of blistering form that has brought him 14 Grand Slams.
And he proved it against Cecchinato, bustling past the 16th seed in just under 70 minutes.
Djokovic will play South Africa's seventh seed Kevin Anderson.
Rising star Zverev was similarly emphatic as he brushed aside Australia's new number one, teenager Alex de Minaur, 6-1, 6-4.
The German fourth seed will face 11th seed Kyle Edmund in the last eight.
The 21-year-old Zverev was ruthless as he took the first set in just 29 minutes, although his 19-year-old opponent showed more fight in the second.
Zverev has been suffering with a cold but ratcheted up the pressure to grab the all-important break of serve in the ninth game before closing out the match against de Minaur.