Spain's Rafael Nadal found himself in trouble in both sets of his third-round match Thursday at the Rogers Cup in Montreal, but he escaped with a 7-6 (8-6), 6-4 victory over big-serving Pole Jerzy Janowicz.

In the opening set, the world No. 4 lost his serve to fall behind 6-5, but he responded in the nick of time to break back and force the tiebreaker.

Things looked bleak again for Nadal soon afterward when Janowicz grabbed a 5-2 lead in the "breaker," but the Spaniard got a mini-break back when the Pole missed a backhand passing shot and then moved ahead 6-5 after his opponent hit a double-fault.

Although Janowicz evened the score at 6-6 with a lucky net-cord winner, Nadal finished off the set two points later with an outstanding backhand overhead winner.

The second set was also a struggle for the 12-time Grand Slam champion, though he was able to shrug off an early service break and finish off the contest without having to play another tiebreaker.

Nadal broke Janowicz's serve three times in the match thanks in part to the Pole's low first-serve percentage (48 percent) and nine double faults.

The Spaniard is trying to get his season back on track after suffering a shocking first-round defeat at Wimbledon in late June at the hands of unheralded Belgian Steve Darcis.

Prior to his loss at the All England Club, Nadal had made an extraordinary comeback this year from a knee injury, making the final of nine consecutive tournaments and winning seven of them, including his eighth French Open title in early June.

After Thursday's win, the 27-year-old said he was pleased with how his knee has responded through two matches on an unforgiving hard-court surface.

"I was able to play without limitations these two matches; hopefully I can continue like this. That's my goal. I will try to forget this injury with my knee," Nadal said.

Next up for the Spaniard will be Australian surprise quarterfinalist Marinko Matosevic, who edged France's Benoit Paire 7-6 (9-7), 6-7 (10-12), 6-3.

In a big upset on Thursday, Latvian Ernests Gulbis stunned world No. 2 Andy Murray of Scotland 6-4, 6-3 and will next take on the winner of Thursday evening's match between Argentina's Juan Martin del Potro and Canadian home-crowd favorite Milos Raonic.

Murray, a two-time winner of the Rogers Cup, was playing his second match since winning his first Wimbledon title last month with a straight-set victory in the final over world No. 1 Novak Djokovic.

The Rogers Cup is one of the biggest hard-court events on the ATP calendar and a key tune-up for the U.S. Open, which gets underway later this month. EFE