An ailing Rafa Nadal added his name to the list of upsets at the Shanghai Masters after the Spaniard suffered a 6-3 7-6 loss to Feliciano Lopez in Wednesday's second round, as fourth-seed Stan Wawrinka and Kei Nishikori also made early exits.

World number one Novak Djokovic kicked off his title defence with a 6-3 6-4 win over Dominic Thiem, while Andy Murray did his hopes of grabbing a spot at the season-ending ATP World Tour Finals no harm with an assured 7-5 6-2 win over Jerzy Janowicz. 

Roger Federer saved five match points and rallied from a 5-2 deficit in the third-set tiebreaker before finally beating Leonardo Mayer 7-5, 3-6, 7-6.

Nadal has been diagnosed with appendicitis which will require surgery and while the world number two tried to play through the pain he was clearly not at his best.

The Spaniard, who could lose his number two ranking to Federer, looked out of sorts as the first set passed him by, but he gave himself a jolt in the second and looked well placed to level the match.

However, Lopez fought back with the same kind of aggression he had been showing in the first set and forced it to a tiebreaker before closing out the match with a terrific volley at the net.

With five spots still up for grabs at the season-ender in London, Australian Open champion Wawrinka, who fell at the first hurdle in Tokyo last week, suffered the same fate in China with a 5-7 7-5 6-4 defeat to Frenchman Gilles Simon.

American Jack Sock produced another upset when he defeated Japan's Kei Nishikori 7-6(5) 6-4.

World number 553 Chuhan Wang's ATP World Tour debut was halted in another second round encounter when Tunisia's Malek Jaziri beat the Chinese wildcard, who had stunned 15th seed Fabio Fognini in the first round, 6-0 6-4.