Madrid: Dominic Thiem edged a thrilling clash with Roger Federer 3-6, 7-6(11), 6-4 to end the Swiss veteran's clay season comeback and reach the Madrid Open semifinals on Friday.
The fifth-seeded Austrian, who saved two match points, will face Novak Djokovic on Saturday after the world number one's opponent Marin Cilic withdrew with food poisoning.
Rafael Nadal beat Stan Wawrinka 6-1, 6-2 to set up a clash with Stefanos Tsitsipas, who edged Alexander Zverev 7-5, 3-6, 6-2 in the other semi.
Federer, playing his first clay tournament for three years, raced into a 4-1 lead inside 15 minutes as he broke the 220 kilometres-per-hour barrier with some powerful serving.
He showed the same drive that saw him bagel Gael Monfils in the first set on Thursday.
The Frenchman had then battled back to force a thrilling tie-break finale in the third set, and Thiem upped his game significantly too, taking the second set to the wire.
Federer survived three game points to hold serve for 3-3 before Thiem eventually triumphed 13-11 in a gripping tiebreak, saving two match points to force a decider.
Thiem broke to go 2-1 in the third. Federer broke back to pull level at 4-4 but the Austrian broke again in the next game, sealing it with a sensational forehand over his opponent before serving out the match.
"Roger is playing really well on clay so I am really happy," said Thiem.
"He's so special, maybe the best player ever in tennis. It's so tough every single time you play against him, it's pure beauty how he plays the game, every point against him is a challenge."
Second seeded Spaniard Nadal made light work of Wawrinka in the night session, looking back to his best after a disappointing semi-final exit at the Barcelona Open and suffering a virus earlier this week.
A five-times winner in Madrid, Nadal reached the semifinals for the 11th time when Wawrinka's attempted backhand return hit the net.
"It was one of my best games for some time," said Nadal.
Tsitsipas played a steady game to beat last year's winner Zverev, who made 14 unforced errors in the opening set.
Zverev roared back in the second but double faulted twice serving at 1-2 down in the decisive third, with Tsitsipas breaking and striding to victory in the battle between two of the sport's young talents.
"I think I deserved the match at the end. I was playing really well, feeling really comfortable on the court," said Tsitsipas. "When you feel like this, you can do miracles."