History-making Kei Nishikori was dumped out of the Shanghai Masters on Wednesday by American Sam Querrey on a day headlined by Roger Federer and Novak Djokovic.

The tall American recovered from losing the first set to seal a 2-6, 6-1, 6-4 win over Nishikori, who made history
on Sunday by becoming the first Japanese player to win the Japan Open.

The 22-year-old Japanese romped into a 4-0 lead in the second-round match and sealed the opener despite a medical timeout late in the set.

But a missed overhead early in the second set contributed to an early break for Querrey and the Japanese 14th seed lost his rhythm, showing his frustration as his rejuvenated opponent, ranked 22nd, levelled the match.

In the third set two breaks of serve proved costly for Nishikori, who is at a career high of number 15 in the rankings after his weekend win over Canada's Milos Raonic, his first on the Tour since 2008.

Federer and Djokovic, the top two players in the world, are in action for the first time on Wednesday after first-round byes but defending champion Andy Murray had a walkover into the third round.

Djokovic, playing Bulgaria's Grigor Dimitrov, has a shot at regaining the world number one ranking if he wins the title and Federer loses before the quarter-finals.

Federer, taking on Taiwanese qualifier Lu Yen-hsun, is playing his first tournament on the Tour since a quarter-final defeat to Tomas Berdych at the US Open.

The Swiss world number one's build-up was clouded by a death threat from a blogger in China but the Internet user, in a fresh posting on the popular baidu.com site, said he had apologised. He remained at large.

A Shanghai police spokesman on Wednesday declined to comment on the case.

World number three Murray, who won the US Open last month, was due to play Florian Mayer but the German withdrew injured.

As the season draws towards to a close there are four places still up for grabs at next month's season-ending World Tour Finals in London. The top three have all qualified, along with the injured Rafael Nadal.