Novak Djokovic had to fight off an upset bid from qualifier Ernests Gulbis, finally defeating the Latvian 5-7 7-6 (9/7) 6-1 on Friday to reach the semi-finals of the Montreal Masters.
Djokovic found himself down a set and a break against the quirky player from the Baltics whose form comes and goes without warning.
Gulbis, whose career best was a Roland Garros semi-final in 2014, has won only eight matches since the start of the year.
But the outsider rose to the big occasion as he forced his world No.1 opponent to save two match points in the second-set tiebreaker of a thriller lasting two and a half hours.
Djokovic levelled at a set apiece and re-established order as he ran away with the third set for the win.
“Very lucky” was the message he scrawled on the camera lens during the traditional tennis match broadcast sign-off.
Djokovic is bidding for his fourth Canadian title and the win puts him into a semi-final against unseeded Jeremy Chardy.
The other two quarter-finals of a day delayed by rain were to feature second seed Andy Murray facing French holder Jo-Wilfried Tsonga and Japan’s fourth-seeded US Open finalist Kei Nishikori taking on resurgent Rafael Nadal, the seventh seed.
Chardy booked his first career appearance in the semi-final of an ATP Masters 1000 event, struggling for three hours to defeat John Isner 6-7 (9/11) 7-6 (15/13) 7-6 (7/4).
Chardy overcame 32 aces from the big American to reach the final four.
He will need to quickly recover after a marathon which only concluded in early evening and threw the day’s schedule at least three hours behind.
The match, which began two hours late due to rain, lasted three hours and eight minutes.
“It was a crazy match, we had the chance, both of us. We did a lot of good points. We were both serving really well. We were really close the whole match,” Chardy said.