Roger Federer saved two match points before claiming a hard-fought victory over Gael Monfils to reach the Madrid Open quarter-finals.
The Swiss fourth seed came from a break down in the deciding set to beat the Frenchman 6-0 4-6 7-6 (7-3).
Federer will face fifth seed Dominic Thiem – who he lost the Indian Wells final to in March – in the semi-finals.
Earlier, world number one Novak Djokovic breezed past France’s Jeremy Chardy 6-1 7-6 (7-2).
The victory was Federer’s 1,200th career win and secured his place in a first clay-court quarter-final since the French Open in 2015.
Rafael Nadal continues his pursuit of a sixth title against American Frances Tiafoe later on Thursday.
- World number one Osaka beaten by Bencic – report
World number three Federer needed just 19 minutes to take the first set over Monfils, dropping just four points on his serve.
However, world number 18 Monfils rallied in the second set, taking advantage as Federer’s first serve faded to force a decider.
Monfils raced to a 4-1 lead in the third set before Federer could force the match back on serve.
The Frenchman brought up two match points on Federer’s serve but the 20-time Grand Slam champion saved them both with a serve and volley.
Federer was the stronger of the two in the tie-break, with Monfils saving two match points before a forehand error secured victory for the Swiss.
He will play Thiem on Friday after the Austrian’s 6-4 7-5 win over Italy’s Fabio Fognini.
Djokovic cruises into quarters – analysis
Jonathan Jurejko, BBC Sport in Madrid
Despite being pushed as the match progressed, Djokovic has yet to drop a set against the world number 47 Chardy, having won all 13 of their meetings.
The 15-time Grand Slam champion moved a double break up in the first set when Chardy double-faulted for 4-0, then fought off a triple break point in the next game before going on to seal the opener in 31 minutes.
Chardy stretched Djokovic more in the second set, as neither player managed to muster a break point until the Frenchman – who had lost their previous 29 successive sets – claimed a set point at 5-4.
But he batted a backhand long as Djokovic, who shook his head after receiving whistles from the Caja Magica crowd as he prepared to serve, thumped down an ace to seal the hold.
That enabled Djokovic to take early control of the tie-break, clinching victory with a forehand winner on his first match point.
The top seed will face Marin Cilic next after the Croat reached his first quarter-final of the season.
Former US Open champion Cilic recovered to win 11 of the final 13 games to beat Serb Laslo Djere 4-6 6-3 6-2.
Switzerland’s Stan Wawrinka also reached the quarter-finals after beating Japan’s Kei Nishikori 6-3 7-6 (7-3).