(Reuters) - World number three and defending champion Roger Federer suffered a surprise defeat in the second round of the Shanghai Masters on Tuesday, losing 7-6(4) 2-6 6-3 to Spain's Albert Ramos-Vinolas.
The Swiss, returning to action after a month off, looked rusty against the 70th-ranked qualifier and despite looking back on track when he cruised through the second set, he succumbed in the decider to a single break of serve.
U.S. Open runner-up Federer, 34, banged down 15 aces and won more points than his opponent but a lack of sharpness at crucial moments sent him spinning to defeat.
Ramos-Vinolas will face either Frenchman Jo-Wilfried Tsonga or Victor Estrella Burgos in the third round.
In other second round action, ninth seed Milos Raonic, one of several players hovering around the cut-off mark for the year-ending ATP World Tour Finals in London, came through against Brazil's Thomaz Bellucci in two tiebreaks.
South Africa's Kevin Anderson, seeded 12, beat German veteran Tommy Haas in straight sets.
Top seed Novak Djokovic, fresh from winning a sixth Beijing title, begins on Wednesday against Slovakia's Martin Klizan.
Andy Murray, seeded three despite moving above Federer in the rankings, plays American Steve Johnson on Wednesday.
(Reporting by Martyn Herman; Editing by Alison Williams)