(CNN) -- Andy Murray's preparations for the defense of his U.S. Open title hit a wall in Montreal as he was beaten in the last 16 by Ernests Gulbis.
The world No. 2 was playing in his first tournament since taking the Wimbledon crown in July but sank to a 6-4 6-3 defeat to his Latvian opponent in the Rogers Cup.
It was Gulbis' first ever win over Britain's number one, and ended a 13-match winning streak for the Scot.
Murray now only has one more tournament in which to fine tune his game before returning to Flushing Meadows, the scene of his first ever grand slam victory 12 months ago.
"I struggled at the start of the first set from the baseline, but then I got more aggressive and took my opportunities," Gulbis said in an on-court interview.
"I started this year at 150 in the world, I was struggling. But slowly and surely I am getting to where I belong. I want to crack the top 20. Then, one or two big wins and you are in the top 10."
It was a different story for Rafael Nadal, who continued his unbeaten run on hard courts this season with a hard-fought win over Poland's Jerzy Janowicz.
The Spaniard, who won the Indian Wells title earlier in the season in his only other hard court appearance, won 7-6 6-4 against his big-serving opponent.
Nadal, also in his first competitive action since his first round loss to Belgian Steve Darcis at Wimbledon, made it 45 wins since returning from a long injury layoff in February.
"I was able to play without limitations these two matches; hopefully I can continue like this," Nadal said during an on-court interview. "That's my goal. I will try to forget this injury with my knee."
The number four seed will now play Australian qualifier Marinko Matosevic in the last eight after he defeated Frenchman Benoit Paire 7-6 6-7 6-3.
World No. 1 Novak Djokovic looked to be heading the same way as Murray when he lost the first set of his match against Uzbekistan's Denis Istomin.
Istomin had only taking five games off Djokovic in their previous two meetings, but the world No. 66 took the opening set 2-6.
But Djokovic roared back to clinch a 2-6 6-4 6-4 victory before donning a fuzzy wig and dancing on court to Daft Punk's "Get Lucky."
The Serb also showed off his dance moves after his first round win over Florian Mayer.
"He was a better player first half of the match," admitted Djokovic. "I was trying to find rhythm. A lot of unforced errors. Just had a very difficult time to be in the point.
"He did a great job in staying very solid and putting a lot of pressure on me. Then I had to fight. It was a very even match up to the last point. Just glad to get lucky and dance on the court after the match."
At the women's Rogers Cup event in Toronto, Serena Williams breezed into the fourth round with a 6-0 6-3 victory over Belgium's Kirsten Flipkens.
Wimbledon champions Marion Bartoli had to retire during her clash with Slovakia's Magdalena Rybarikova while there were victories elsewhere for Li Na, Agnieszka Radwanska and Sara Errani.