Updated

Doha, Qatar (SportsNetwork.com) - World No. 1 superstar Rafael Nadal barely won his second-round match, while two-time champion Andy Murray went by way of an upset Wednesday at the $1 million Qatar Open.

The reigning U.S. and French Open titlist Nadal was tested mightily before sneaking past German Tobias Kamke 6-3, 6-7 (3-7), 6-3 in 2 hours, 25 minutes on Day 3. Nadal broke Kamke's serve three times, while the German could manage only one break in the hard-fought loss.

The 2010 Doha runner-up Nadal's quarterfinal opponent on Thursday will be dangerous Latvian Ernests Gulbis.

Meanwhile, capable German Florian Mayer rung in the new year by coming back to stun the third-seeded British star Murray 3-6, 6-4, 6-2 in 1 hour, 52 minutes on the hardcourts at Khalifa International Tennis and Squash Complex.

Mayer overcame a one-set and 0-3 deficit in order to erase Murray.

"To be honest, in my mind, the match was finished at 3-6, 0-3," said Mayer. "But I tried to play more aggressively, tried to risk something more. Of course for sure he didn't play his best tennis.

"I knew before the match if I would have a chance, it's probably today. He didn't play for a long time. So I took my chance."

Murray returned to action for the first time in three-and-a-half months with an easy 37-minute 6-0, 6-0 win here on Tuesday, but Mayer posed a much bigger problem than helpless Qatari wild card Mousa Shanan Zayed did on Day 2.

The Wimbledon titlist and 2008 and 2009 Doha winner Murray underwent minor back surgery last season and hadn't played anywhere since mid-September.

Another surprising upset by a German came when Daniel Brands vanquished second-seeded French Open runner-up David Ferrer 6-4, 7-5, while Gael Monfils popped nine aces and broke serve four times in eliminating defending Doha champ and fifth-seeded fellow Frenchman Richard Gasquet 6-2, 7-5. Gasquet defeated Russian and 2010 champion Nikolay Davydenko in last year's finale.

Also in Doha, Peter Gojowczyk upended sixth-seeded fellow German Philipp Kohlschreiber 7-6 (7-4), 7-6 (9-7); a seventh-seeded Gulbis held off Poland's Lukasz Kubot 6-2, 4-6, 6-3; Romanian Victor Hanescu knocked out eighth-seeded Spaniard Fernando Verdasco 4-6, 7-6 (7-0), 6-2; and German qualifier Dustin Brown withstood 22 aces and saved four match points before outlasting 6- foot-10 Croat Ivo Karlovic 3-6, 7-6 (15-13), 6-4 at this Australian Open tune- up.

Thursday's other quarters will pit Monfils against Brands, Brown versus his compatriot Gojowczyk, and Hanescu against Mayer.