Roger Federer was pushed hard by Xavier Malisse before reaching the semi-finals of the Toronto Masters Series event.
Federer has won 52 straight hardcourt games in the US and Canada
The Swiss world number one eventually prevailed 7-6 (7-4) 6-7 (5-7) 6-3 over the Belgian to book a semi-final against Chile's Fernando Gonzalez.
Gonzalez beat Argentina's Jose Acasuso 6-1 7-5 to clinch a final-four berth.
France's Richard Gasquet will play Andy Murray after seeing off 13th seed Tomas Berdych 6-4 6-1. Murray beat Jarkko Nieminen 6-4 6-7 (0-7) 6-3.
Federer admitted afterwards that Malisse had made him work for his win.
"When it was 5-5 in the first set before I had my first break point, I said to myself, 'OK, it's going to be a tough night'."
"But I won the deciding game and after that there was never any doubt."
Federer, who has won 52 North American hardcourt matches in a
row, needed two hours and 27 minutes to seal victory.
Gasquet, who has already won ATP titles this year at Nottingham and Gstaad, took his first set in 35 minutes when Berdych sent a backhand long.
In the second set, Gasquet disrupted the Czech's rhythm as he failed to reproduce the form that ousted French Open winner Rafael Nadal, the defending Canada Masters Series champion, in the previous round.
The 20-year-old, ranked 51st in the world, went on to win in 65 minutes.