Defending Shanghai Masters champion Roger Federer avoided a third-round upset against Roberto Bautista Agut as he came through in three sets to clinch a quarter-final meeting with Kei Nishikori.
The Swiss, whose ranking as number two in the world is under threat this week, was broken three times in the second set to force a decider but eventually prevailed 6-3 2-6 6-4.
Bautista Agut had never even taken a set off Federer in their previous seven meetings but forced a decider only to be crucially broken at 4-4, and the Swiss served out to love to clinch the win.
Federer will now meet Nishikori, who he has not lost to since 2014, for the first time since the 2017 Australian Open.
Not quite# peRFect, but good enough. @rogerfederer's quest to defend his #RolexSHMasters title forges ahead with a hard-fought 6-3, 2-6, 6-4 win over @BautistaAgut . Gets No. 8 @keinishikori in tomorrow's quarterfinal! pic.twitter.com/2Cc6JV5YTt— RolexShMasters (@SH_RolexMasters) October 11, 2018
There were signs this was not going to be a straightforward evening for Federer early in the first set when Bautista Agut had a break point in the Swiss' second service game.
He could not capitalise, though, and Federer soon gained a 3-1 lead en route to taking the opener.
Federer won an 11-minute game at the start of the second set to break Bautista Agut again before the Spaniard instantly roared back and reeled off four games in a row.
Bautista Agut then forced a decider by breaking Federer for a third time, successfully winning a challenge to bring up set point, which he took when his opponent netted a backhand.
The third set remained on serve until, at 4-4, Federer claimed his first break since the start of the second set, and he capitalised to secure another hard-fought win having also beaten Daniil Medvedev in three sets on Wednesday.
"It was a very tough match, I thought it was a really high level," Federer said afterwards.
"They're tough conditions – the ball stays super low, it's fast, it's cooler.
"If you want to make the winner you have to take a lot of risks, it seems like. If you find a great groove, it's hard to go through the opponent."
|Injury-plagued Nuggets beat Thunder to hold Western Conference lead|
|Southee takes five as Sri Lanka recover in Wellington|
|Kings troll Curry by playing clips of moon landing|
|Guardiola: Premier League title race similar to Barca-Madrid battles|
|Ovechkin joins rare NHL club with second straight hat-trick|
|Liverpool can´t be judged just on trophies – Klopp responds to Mourinho|
|Athletics´ Chapman undergoes procedure on left shoulder|
|Marcelo: Real Madrid miss Ronaldo|
|Ronaldo right about Juventus team spirit – Allegri|
|Klopp: I´m not the pope of football tactics|
|Stade beat Ospreys on emotional Chauvin tribute night|
|Ligue 1 survival bid a marathon not a sprint for Monaco, as club appoints distance runner|
|Vertonghen eyeing Spurs future beyond 2020|
|De Bruyne injuries could be a blessing for City, says Guardiola|
|Emery prepared to face Arsenal´s centre-back crisis|
|Ulster complete Scarlets double, Exeter gain Gloucester revenge|
|Sheffield United 1 West Brom 2: Baggies comeback boosts automatic promotion push|
|Del Potro back on court following knee injury|
|Canelo v Fielding: Rocky ready to write his own fairytale in New York|
|Boca part company with Schelotto after Copa Libertadores loss to River|
|Canelo v Fielding: Tale of the tape|
|Juventus defender Cancelo has knee surgery|
|Canelo v Fielding: Alvarez and Rocky make weight in New York|
|Spalletti does not fear another mid-season crisis at Inter|
|Salah headlines CAF Player of the Year shortlist as Koulibaly misses out|
|Beckham Jr. out of Titans clash|
|Lipsky hits the front at Leopard Creek|
|Pederson coy over Wentz back injury|
|Liverpool ´not really likely´ to be active in January window, reveals Klopp|
|Always on the move and unpredictable - Pavard reveals surprising choice over toughest opponent|
|We need to get back to respect - Lampard alarmed by hate in football|
|Giles returns to England to replace Strauss as director|
|Hansen has no issue with Milner-Skudder Toulon switch|
|Juventus to rest Ronaldo after Torino showdown|
|Titmus strikes gold again as world records tumble in Hangzhou|
|Malinga to captain Sri Lanka in New Zealand|
|Rivaldo would like ´excellent´ Isco at Barcelona|
|United a long way from Mourinho´s vision|
|´Klopp denies an answer!´ - Liverpool boss dismisses questions about ´world-class´ Pogba|
|Returning Nowitzki ´so tired´ after making NBA history|
|Aguero and De Bruyne in contention for Manchester City v Everton|
|Simeone has no plans to cash in on Costa|
|Canelo v Fielding: Alvarez´s greatest nights|
|Fabregas: Chelsea being unfairly scapegoated over racism allegations|
|Crisis? What crisis? Klopp focuses on defensive solutions for United clash|
|Hope cannot inspire Windies as Bangladesh cruise to series win|
|Benitez picks up Premier League Manager of the Month award|
|Chavez, Marquez and Canelo - Mexico´s greatest multi-weight world champions|
|Bale set to miss Real Madrid v Rayo Vallecano|
|Robben out until January as Bayern look to avoid serious injury|
|Milan avoid UEFA ban in FFP punishments.|
|Mourinho compares Liverpool to ´an amazing house´ but insists trophies matter|
|Brisbane Roar 2 Melbourne Victory 4: Muscat´s men hit A-League summit|
|Bumrah confident second Test is ´in the balance´ after India recovery|
|Isco gesture was for a corner or foul, claims Solari|
|Harris leads Australia into ascendancy on day one|
|ATP announces candidates to host future Finals|
|Ronaldo: Juventus fans refuse to lose to Torino|
|Hero Rivers feared he had cost Chargers in KC|
|Williams would welcome Llorente back to Athletic Bilbao|
|Liverpool v Manchester United: Minding the gap|
|Milan elimination unjust, fumes Leonardo|
|Paul hails ´sick´ Harden after record-breaking display|
|Liverpool v Manchester United: Salah, Mane and Firmino v Rashford, Martial and Lukaku in Opta number|
|Canelo open to GGG trilogy as he chases place in Mexican history|
|The big Friday Premier League quiz|
|Harden posts record fourth 50-point triple-double in win over Lakers|
|Barcelona squad happy with Dembele, says Alba|
|Chargers rally past Chiefs to clinch playoff spot|
|WATCH: Chargers top Chiefs on dramatic two-point conversion in final seconds|