(Updates with Federer win)
Oct 10 (Reuters) - Kei Nishikori's dream run that took him to the Japan Open tennis title last week was cut short in China when he lost 6-2 1-6 4-6 to Sam Querrey of the U.S. in the second round of the Shanghai Masters on Wednesday.
The 14th seed, who became the home country's first Japan Open champion on Sunday, won the first set and went 3-1 up in the third before Querrey rallied to beat him.
The 22-year-old Nishikori breezed through the first set but needed treatment on his right ankle after which he lost his rhythm.
"I tried to play, but he had a good serve. I broke him first in the third set but couldn't finish the match. It's disappointing," the Japanese world number 15 told reporters.
"I had some serious pain in my right ankle. It hurt all the way through the Japan Open and hurt yesterday and today.
"My left knee also hurt. If I am honest my whole body is tired. Today I also played to my absolute limit until the end."
World number one and top seed Roger Federer of Switzerland opened his campaign with a 6-3 7-5 win over qualifier Lu Yen-Hsun of Taiwan.
Federer, who broke his opponent once in each set, will take on compatriot Stanislas Wawrinka in the third round.
Second seed Novak Djokovic of Serbia, who last week won the China Open, began with an easy 6-3 6-2 win against Bulgaria's Grigor Dimitrov in the second round.
Britain's Andy Murray, the defending champion, advanced to the third round when his German opponent Florian Mayer withdrew with an injury.