Andy Murray reached his first Masters semi-final with a 6-4 6-7 (0-7) 6-3 win over Finn Jarkko Nieminen in Toronto.
If Murray beats Richard Gasquet he will reach a Masters final
The British teenager struggled with his first serve during a gruelling match, but hit more classy shots than his opponent, who is ranked in the top 15.
Murray was the dominant player in the first set and served for the match in the second before capitulating to an ugly whitewash in the tie-breaker.
But he rallied to take a 5-2 lead in the decider and eked out a fine win.
The positives outweighed the negatives for Murray, even if his serve was erratic.
But the Scot showed more ambition than his opponent when it mattered most and produced a string of fine winners when given very little margin for error.
I'm obviously disappointed I didn't finish it off in two, but it was a good effort to keep it together mentally in the third set
It looked as if Murray's chance had passed when he limply handed over his serve and hard-earned initiative at 5-3 in the second set.
Nieminen, who was showing signs of fatigue after a hard win on Thursday, sprang back to life to run away with the ensuing tie-break.
Murray could have lost his way at that point, but showed maturity to outlast the seasoned 14th seed.
He will next face Richard Gasquet in the last four, after the Frenchman brushed aside 13th seed Tomas Berdych 6-4 6-1.
Murray was pleased with his performance, but had reservations.
"To be fair I thought I was in control of most of the match. I felt like I was making him do more of the running," he said.
"I was 6-4, 5-3 up serving. Every time I serve for it this week, I've lost my serve.
"I'm obviously disappointed I didn't finish it off in two, but it was a good effort to keep it together mentally in the third set.
"I came in well on his second serve. I got good depth on the return and covered the net. I used the drop volleys well."