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."
|Suns owner Sarver committed to keeping team in Phoenix|
|Chargers WR Allen leaves with injury after near-spectacular catch|
|Socceroos not giving up on Mooy for Asian Cup|
|Cooper says Raiders owner wanted to trade him to Cowboys|
|Pochettino jokes Levy is ´worried´ about losing him|
|Barcelona would welcome Morata – Alba|
|Toure not a priority for West Ham – Pellegrini|
|Koscielny no certainty to face Southampton, says Emery|
|We gifted the game – AC Milan boss Gattuso furious after Europa League exit|
|My season starts now, says Koscielny|
|Cipriani ´at peace´ with latest England snub|
|Laporte: Deschamps must have personal reasons for France snub|
|Morata injury not too serious, claims Chelsea boss Sarri|
|Hansen to leave: All Blacks coach returning focus to World Cup defence|
|I want to fight the champion! - Joshua reiterates Wilder in April ambition|
|Gundogan glad to leave Christmas holidays behind|
|I know how it feels and it hurts - Gundogan on Sterling abuse|
|Celtic 1 Red Bull Salzburg 2: Scottish champions through despite defeat|
|Olympiacos 3 AC Milan 1: Rossoneri crash out of Europa League|
|Arsenal 1 Qarabag 0: Lacazette on target as Saka shines|
|Hansen to leave: All Blacks will take time to name replacement|
|Chelsea condemn alleged anti-Semitic chanting from fans|
|Hansen to leave: The best Opta facts from New Zealand coach´s tenure|
|Hansen to leave: Five contenders to be the next All Blacks coach|
|Hansen to leave: Highs and highs of his All Blacks reign|
|Hansen to leave All Blacks after World Cup|
|Rapid Vienna 1 Rangers 0: Late Ljubicic winner sends Gerrard´s men out|
|Beckham continues to miss Giants practice with quad injury|
|Vidi 2 Chelsea 2: Giroud spares Sarri´s side in lacklustre draw|
|Paris Saint-Germain and Marseille fixtures among latest Ligue 1 cancellations|
|Santos turn to ex-Argentina boss Sampaoli|
|Muller could miss Champions League last 16 after Tagliafico kick|
|Home hope Bekker out in front at Alfred Dunhill Championship|
|Van Bommel in touch with Robben over PSV reunion|
|Pinarello chief confident over Team Sky future|
|Stade make Ospreys tickets free in tribute to teenager|
|WRC great Loeb seals Hyundai switch|
|Madrid rumours better than sack talk, says Pochettino|
|Nadal to join Federer at 2019 Laver Cup|
|Prigoda smashes world record, Hosszu dethroned in Hangzhou|
|Former Juve CEO Marotta takes over at Inter|
|Glenn to stand down as FA boss next year|
|Muller apologises to Tagliafico for kick to the head|
|Pereira pleads for more Manchester United chances|
|Griffin hails ´phenomenal´ Lowry after Warriors demolition|
|I´ve played with Zidane and Henry, but Messi is something else – Pires|
|Dragons forward Jack de Belin charged with sexual assault|
|Durant: Raptors are the real deal|
|Cocu bids farewell to Fenerbahce after ´mutual agreement´ is made over October sacking|
|Australia unchanged for historic Perth Test|
|Champions League draw: The possible last-16 ties|
|Southee happy to be back on home soil|
|I wouldn´t swap Dembele for Neymar – Pires|
|Canelo ready to risk heavy weather against Fielding|
|Raptors upstage Warriors, Davis leads Pelicans with 44 points|
|India skipper Kohli excited by green Perth wicket|
|PSG? I haven´t decided my future yet – De Jong|
|Marcelo: Real Madrid don´t have attitude problem|
|India pair Ashwin, Rohit ruled out of second Test|
|Kovac: Ajax-Bayern draw was amazing|
|Sims re-signs with Dragons until 2022|
|Derrius Guice injury update: Redskins RB (knee) has rehab setback, undergoes 3 more procedures|
|Emery: Arsenal could sign defender in January|
|Phillies sign McCutchen to three-year deal|
|O´Neal thinks his Lakers teams could ´easily´ beat Warriors|
|A-League to add two clubs by 2020|
|Curry says he was ´obviously joking´ about moon landing comments|
|Now the beautiful part starts – Ronaldo ready for Champions League knockout stage|
|Bayern have a lot more potential – Lewandowski not satisfied despite top spot|
|Lyon star Fekir shares plaudits for Champions League progression|