(REUTERS) - World No. 3 and defending champion Roger Federer suffered a surprise defeat in the second round of tennis' Shanghai Masters on Tuesday, losing 7-6 (7-4), 2-6, 6-3 to Spain's Albert Ramos-Vinolas.
The Swiss great, returning to action after a month off, looked rusty against the 70th-ranked qualifier and despite appearing to be back on track when he cruised through the second set, he succumbed in the decider to a single break of serve in the eighth game.
US 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, 27, had never beaten a player ranked in the top 10 before. His reward for some fearless tennis was a third-round meeting with Frenchman Jo-Wilfried Tsonga, who outclassed Victor Estrella Burgos in straight sets.
"I'm really happy to beat Roger Federer," he told the ATP's website (www.atpworldtour.com). "I didn't expect it during the match. After the second set I thought I would lose. But I played really good. I was very solid with my serve in the third set. I am very happy because it's the most important victory for me."
Ninth seed Milos Raonic, one of several players hovering around the cut-off mark for the year-ending ATP World Tour Finals in London, reached the second round when he came through against Brazil's Thomaz Bellucci in two tie-breaks.
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 third despite moving above Federer in the rankings, plays American Steve Johnson on Wednesday.