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."
|Ajax star De Ligt wins Golden Boy award|
|Foles fuels Eagles´ upset win over Rams|
|Latham carries bat as New Zealand leave Sri Lanka reeling|
|Keep your cool, Virat – Paine and Kohli in another confrontation|
|Depleted Nuggets complete season sweep of Raptors|
|Fabinho was ´outstanding´, says Klopp|
|Patriots QB Brady on loss to Steelers: We aren´t playing well enough to win|
|Elliott says Cowboys´ shut-out loss to Colts was embarrassing|
|De Bruyne not worried about Liverpool title challenge|
|Sixers star Simmons makes history with triple-double|
|WATCH: Nowitzki receives standing ovation in first home game of season|
|Seattle´s playoff spot on hold after Seahawks suffer OT loss to 49ers|
|Cheika survives as Wallabies coach, Johnson appointed|
|Vikings remain in NFC playoff picture|
|Steelers stay ahead as Patriots lose AFC´s second seed|
|Lionel Messi is the best, says Amor|
|I´m still tired just looking at Robertson – Mourinho in awe of Liverpool intensity|
|Casillas takes swipe at Mourinho after United lose to Liverpool|
|Valverde relieved as Messi brilliance prevents another Levante nightmare|
|WATCH: Leno proposes to girlfriend after Bears clinch division title|
|Messi and Suarez the world´s best strike partnership, says Pique|
|Klopp: I cannot keep every Liverpool player happy|
|Messi and Suarez outscoring Real Madrid and Atletico in LaLiga|
|Levante 0 Barcelona 5: Marvellous Messi banishes ghosts of last season|
|Colts rout Cowboys to keep playoff hopes alive|
|Bears shake off Packers to win NFC North and return to playoffs|
|Mourinho explains Pogba omission and defends Lukaku´s Liverpool showing|
|Liverpool´s display against Manchester United one of the best, claims Klopp|
|Look away Jose! Damning stats expose Manchester United´s limp Liverpool loss|
|Time´s up, Mourinho: Manchester United can dither no longer|
|Manchester United´s players are not dishonest – Mourinho|
|Manchester United´s lack of ambition under Mourinho is scary – Keane|
|Mourinho: All Manchester United can achieve is fourth|
|Quagliarella should be protected by UNESCO, jokes Sampdoria coach|
|Manchester United surpass last season´s goals-against tally in first 17 games|
|Hasenhuttl revels in ´unbelievable´ victory over Arsenal|
|Liverpool 3 Manchester United 1: Shaqiri´s late show bails out Alisson as Reds return to the top|
|Edinburgh in control in Champions Cup, Racing win again|
|Emery ponders January signing after Bellerin injury|
|It is only a knock – Sarri plays down Hazard injury fears|
|Redskins QB Alex Smith released from hospital|
|Starc: If I listen to Warne, I may as well retire|
|Curry interviews retired NASA astronaut, apologises for moon comments|
|Hazard refusing to give up on Premier League title hopes|
|Ziyech & Blind score hat-tricks as Ajax claim 8-0 win|
|Canelo v Fielding: What next for three-weight champion Alvarez?|
|Southampton 3 Arsenal 2: Austin and Ings end Gunners´ long unbeaten run|
|Brighton and Hove Albion 1 Chelsea 2: Sensational Hazard proves the difference|
|Pogba on the bench as Clyne starts for Liverpool|
|Lipsky ends long barren spell in Malelane|
|Lakers´ Stephenson to repeat air guitar despite technical|
|Fletcher pushed Miller on to Broncos sack record|
|The Sarri effect: Hazard surpasses 2017-18 goal involvements in just 16 games|
|Van der Burgh retires on a high note with breaststroke double|
|Rashford: Liverpool was never an option|
|No team Liverpool play this season will be as motivated as Man United – Klopp|
|India surprised by contentious Kohli decision - Bumrah|
|The Sunday Seven - 7 Key Opta facts for NFL Week 15|
|Miller eyeing Joshua bout at Madison Square Garden|
|Finch cleared of serious damage after another finger blow|
|Rashford ´untouchable´ because he plays on his limits – Mourinho|
|It´s important to have his mentality - Mayfield thrilled with Kobe Bryant visit as Browns beat Bronc|
|Centurion Latham indebted to ´world-class´ Williamson|
|Spurs´ Dier out until January after appendix removal|
|A-League Review: Glory down Jets to stay unbeaten|
|Philander ruled out of first Test|
|Controversial Kohli dismissal puts Australia in command|
|Thunder´s Westbrook: ´When we defend like that — best team in the league´|
|Kante at his best further forward, reiterates Sarri|
|Rose capitulates in Indonesia to squander chance to top rankings|