Roger Federer saw off Gael Monfils having saved two match points as he secured a place in the Mutua Madrid Open quarter-finals with the 1,200th win of his career.
Federer will face Dominic Thiem in the last eight after triumphing 6-0 4-6 7-6 (3) against France's Monfils in two hours.
The third set saw the Swiss fight back from 4-1 down to bring things level and then save two match points at 5-6 before claiming victory via the tiebreak.
Federer becomes the second player in the Open era to reach 1,200 wins, following Jimmy Connors (1,274).
Austrian Thiem, the beaten finalist in 2017 and 2018, got past Italy's Fabio Fognini 6-4 7-5.
Novak Djokovic advanced with a 6-1 7-6 (2) win against Jeremy Chardy, and will now take on Marin Cilic, who fought back to beat Laslo Djere 4-6 6-3 6-2.
Five-time winner Rafael Nadal defeated Frances Tiafoe 6-3 6-4 to set up a clash with Stan Wawrinka, a 6-3 7-6 (3) victor against Kei Nishikori.
The other quarter-final will be between defending champion Alexander Zverev and Stefanos Tsitsipas - they beat qualifier Hubert Hurkacz and Fernando Verdasco respectively, with Zverev bouncing back after losing the first set.