Roger Federer overcame a significant scare at the hands of Adrian Mannarino to remain on course for an eighth Swiss Indoors Basel title, as Juan Martin Del Potro claimed another valuable victory on Friday.
Federer, who has already won six titles in 2017, was well below his best in the first set of his quarter-final against Mannarino, making errors on an uncharacteristically frequent basis.
However, the 19-time grand slam champion rallied to triumph 4-6 6-1 6-3 and set up a last-four tie against either David Goffin or Jack Sock.
Although he ultimately suffered a fifth defeat in as many meetings with Federer, Mannarino came close to springing a huge upset.
The Frenchman had two break points when leading 3-2 in the final set, but Federer responded superbly - saving the second with an outrageous backhand half-volley - and charged to the winning line thereafter.
Del Potro continued his late charge towards an unlikely spot in the ATP World Tour Finals by seeing off sixth seed Roberto Bautista Agut 6-2 2-6 6-4.
The 2009 US Open champion won the Stockholm Open last weekend and another title on Sunday would move him up to eighth in the battle to qualify for the season-ending tournament in London.
Del Potro will face Marin Cilic in the last four after the defending champion made hard work of beating qualifier Marton Fucsovics 7-6 (7-3) 5-7 7-6 (7-4).