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."
|Slovenia sack Kavcic as head coach|
|Morgan and Rashid star as England win rain-reduced ODI in Sri Lanka|
|Romagnoli aims to make Gattuso proud in Milan derby|
|Naldo signs Schalke extension|
|Bills to start quarterback Anderson against Colts with Allen out|
|O´Sullivan makes 147 at ´hellhole´|
|Barcelona know when captain Messi is angry – Abidal|
|Bertens loss hands Pliskova last WTA Finals berth|
|Liverpool star Mane undergoes hand surgery|
|F1 Raceweek: Happy hunting ground for title-chasing Hamilton - US GP in numbers|
|Canelo signs record-breaking DAZN deal|
|England hit by another Vunipola injury absence|
|Gruden: Oakland Raiders ´aren´t tanking´|
|Chiesa focused and happy at Fiorentina|
|We´ll see what´s possible - Henry not limiting Monaco´s ambitions|
|Wembley sale off after Khan offer withdrawn|
|Football needs people like Arsene - Pires keen for Wenger return|
|Abbas five-for torments woeful Australia as Pakistan take control|
|Henry: Wenger and Guardiola inspirations for my coaching career|
|Pires backs Henry and Vieira for Ligue 1 success|
|Bolt rejects Valletta offer|
|Wenger ready for January return to management – but where?|
|NBA 2018-19: The LeBron James effect on teams he has joined|
|Svitolina qualifies for WTA Finals after Pliskova loses|
|Genoa will sell ´superstar´ Piatek, admits president|
|Moutinho targets European qualification with Wolves|
|Embiid: 76ers-Celtics isn´t a rivalry, they always kick our a**|
|Vinicius ´calm´ as he waits for Real Madrid chance|
|Nothing else to say - Ramos posts clip of supposed Sterling stamp|
|Chiellini joins Mind the Gap campaign to help players prepare for retirement|
|Injured Kusal Perera replaced by Kusal Mendis in Sri Lanka squad|
|Big names return for Scotland´s November Tests|
|Essien tells Loftus-Cheek to stay and fight for Chelsea chance|
|Nainggolan relishing challenge of first Milan derby|
|Curry: Slap me if I tire of championship celebrations|
|Sevilla don´t fear Messi or Barca – Kjaer|
|Low: Dropped Muller is still very important for Germany|
|Hayward put ´dark memories´ behind him with Celtics return|
|I hope I´m in Klopp´s good books! - Koeman jokes after resting Wijnaldum|
|Rested Fellaini should be fit for Manchester United, says Martinez|
|France´s mentality must be right - Lloris|
|Bellinger seals dramatic win as Dodgers level up NLCS|
|Curry, Durant lead Warriors past Thunder|
|Kjaer surprised by LaLiga-leading Sevilla as Machin´s men remain grounded|
|A-League preview: Honda the big arrival as fascinating season awaits|
|Mexico 0 Chile 1: Sanchez helps La Roja to late win|
|Celtics too good for 76ers in NBA opener|
|United States 1 Peru 1: Flores salvages late draw for visitors|
|Martinez not worried about Belgium depth|
|Red Sox move ahead of Astros in ALCS|
|Depay ´a joy to watch´, says Koeman|
|Timberwolves owner looking to trade Butler, backs Thibodeau|
|Shepard says Giants have ´total faith´ in Manning|
|Hazard is out of this world – De Ligt enjoys Belgium test|
|Tite: Brazil were better than Argentina|
|Foley eyes World Cup after re-signing with Wallabies, Waratahs|
|Low slams decisive France penalty call|
|I fined him for his goal at Old Trafford! Giggs delighted for Wales hero Wilson|
|Matuidi lauds Deschamps´ tactical nous after Germany win|
|Scaloni excited by Argentina despite Brazil loss|
|Tsonga back in business, Dzumhur dumped out in Moscow|
|Germany suffer six defeats in a year for first time|
|Many clubs have asked about Piatek - agent|
|Bartomeu: Barca open to defensive reinforcements after Vermaelen injury|
|Bonn spoil PAOK´s landmark European game|
|Konta conquers Mertens in Moscow|
|Republic of Ireland 0 Wales 1: Wilson stunner moves Giggs´ side top|
|France 2 Germany 1: Griezmann delivers Low blow as Les Bleus reign in Paris|
|Belgium 1 Netherlands 1: Groeneveld cancels out Mertens strike|
|Argentina 0 Brazil 1: Miranda heads late winner after rivalry fails to ignite|